Discussion: setcookie
Afficher un message
Vieux 12/03/2008, 15h17   #5
Wolf
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] set



Tim Daff wrote:
> Hi,
>
> I am learning PHP, I am trying to set a simple :
>
> <html>
> <head>
> <title></title>
> </head>
> <body>
>
> <?php set('test', 45, time()+(60*60*24*7)); ?>
>
> </body>
> </html>
>
> Firefox is returning this error:
>
> Warning: Cannot modify header information - headers already sent by
> (output started at /Users/Daff/Sites/php_sandbox/.php:7) in
> /Users/Daff/Sites/php_sandbox/.php on line 7
>
> I have googled this and can't find out what I am doing wrong. Any
> you could give me would be much appreciated.
>
> Tim


<?php set('test', 45, time()+(60*60*24*7)); ?>
<html>
<head>
<title></title>
</head>
<body>



</body>
</html>

HAVE to be at the top of the page... You output ANYTHING else
and you get the error you wound up getting.

Wolf

  Réponse avec citation
 
Page generated in 0,04570 seconds with 9 queries