Re: Can Someone Explain this error message to me?

From: Date: Mon, 14 Apr 2003 11:12:16 +0000
Subject: Re: Can Someone Explain this error message to me?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-143742@lists.php.net to get a copy of this message
Hi, Keep the sessions code right on top, make sure you dont even have a "space" character before the sessions and you should be ok. Its just saying that before your sessions code goes that your headers have already been sent..... Cheers, -Ryan ----- Original Message ----- From: "Hunter, Jess" <JHunter@SPFLDSPARC.ORG> To: "PHP Mailing List" <php-general@lists.php.net> Sent: Monday, April 14, 2003 12:57 PM Subject: [PHP] Can Someone Explain this error message to me? > Of all the things I have tackled this far with PHP, user authentication has > eluded me the most. I understand the basic concepts of security and am even > able to create a sinple logon scrip that puttls data from a MySQL table. but > when it comes to session, I guess I just can't grasp the whole sessions > concept. > > I went to a website to try and get some help through some sample code. I > have the script installed and have defined the variables in the .inc filed. > I am getting the following errors when I try to run it and I don't > understand what it is trying to tell me. > > I have also pasted the section of the script that I believe this is > referencing. > > If someone could have a look and try to break this down into non-techno-ese > for me I would appreciate it. > > > Thanks, > > Jess > > > Warning: Cannot add header information - headers already sent by (output > started at /var/www/testbed/login.inc:8) in /var/www/testbed/login/login.inc > on line 14 > > Warning: Cannot add header information - headers already sent by (output > started at /var/www/testbed/login.inc:8) in /var/www/testbed/login/login.inc > on line 15 > > > > $userInfo = mysql_query($sql); > if($user = mysql_fetch_object($userInfo)) > { > setcookie(userID, "" . $Username); > header("Location: $afterLoggedIn?user=" . > $user->$useridField); > } > else > { > $error = "$errorMessage"; > } > } > > if(($error || !$userID == $user || $userID=="" ) && !$action == "register" ) > { > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#143742) next »