|
Posted by Jerry Stuckle on 09/26/21 11:37
Fernando Rodríguez wrote:
> Hello Pedro,
>
>> Please post the rest of your code
>
>
>
> OK, here's the full code:
>
> -----------------------------------
> <html>
> <head>
> <title>Untitled Document</title>
> <? $cookieValue = 'abra cadabra, pedo de cabra';
> setcookie('aTestCookie', $cookieValue, time() + 3600); ?>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
>
> <body>
>
>
>
> <ol>
> <li> <a href="http://es2.php.net/FAQ.php">PHP FAQ</a></li>
> <li> <a
> href="http://es.php.net/manual/en/tutorial.firstpage.php">PHP
> Tutorial</a></li>
> <li> <a href="http://es.php.net/manual/en/index.php">PHP
> Manual</a></li>
> </ol>
>
>
> <form action="action.php" method="post">
> <p>Your name: <input type="text" name="name" /></p>
> <p>Your age: <input type="text" name="age" /></p>
> <p><input type="submit" /></p>
> </form>
>
> </body>
> </html>
> ------------------------------------
>
> This causes the follwoing output:
>
> Warning: Cannot modify header information - headers already sent by
> (output started at c:\proyectos\websites\test\index.php:4) in
> c:\proyectos\websites\test\index.php on line 6
>
>
And it's correct. The headers are output as soon as ANY text is sent to
the browser - in this case the headers were sent at the first line of
your page:
<html>
Put the setcookie code immediately at the top of your file, and ensure
there is no white space (or anything else) before it.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|