PHP Cannot Create Cookies

Started by G_G, March 12, 2011, 04:20:52 pm

Previous topic - Next topic

G_G

March 12, 2011, 04:20:52 pm Last Edit: March 12, 2011, 04:29:43 pm by game_guy
I get this error.
Warning: Cannot modify header information - headers already sent by (output started at /home/decisiv1/public_html/igimage/account.login.php:9) in /home/decisiv1/public_html/igimage/account.login.php on line 84

When I call this
setcookie("user", $data['user_id']);

Any ideas? Is it branden's host or what?

I kinda need cookies to keep track of logins. Unless theres another way.

EDIT: I know why its not working but that still doesn't solve my problem because I have to create the cookie at the spot its at.

It won't let you set a cookie if there are any html tags before your PHP code, but if the set cookie is before the html tags it works just fine. Knowing this just makes my problem 10x harder.