Page 1 of 1

cookie and header error

Posted: Wed Mar 19, 2008 4:26 am
by m2babaey
Hi
is setting cookie sending output?
I get this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/pw64/public_html/sitesaz/regt.php:8) in /home/pw64/public_html/members/saleconfirmed.php on line 37
line 37 is :

Code: Select all

36  $past = time() - 3600; 
37  setcookie('refferer', $userid, $past);
and i cannot chage this line or line 8. is there a solution?

Re: cookie and header error

Posted: Wed Mar 19, 2008 7:31 am
by thomas777neo
Looks like you are printing information before you actually set the cookie. Have it that the cookie is the first thing that is created, then print the other information as usual