sesion error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Gavski
Forum Newbie
Posts: 19
Joined: Thu May 16, 2002 2:30 pm
Location: UK

sesion error

Post by Gavski »

I am trying to post session variables:-



session_register("varname");
echo "<INPUT='TEXT' NAME='varname'>...etc..SUBMIT.

the variable is saved and transfered to the next page fine,
but at the beginning of the first page I get an error:-

Warning: Cannot send session cookie - headers already sent by(c:\pathname......)

This is on a localintranet- Apache server setup

Anyone know why I'm geting this error????

Thanks
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

You must not send even a single character of the content before you're using session_start()

Code: Select all

<html><?php session_start().....
that doesn't work
User avatar
Gavski
Forum Newbie
Posts: 19
Joined: Thu May 16, 2002 2:30 pm
Location: UK

Post by Gavski »

Yea, thanks Volka, works fine now, sweet
Post Reply