Re: header,session stuff works on live fails on dev...?

From: Date: Fri, 31 Aug 2001 10:48:08 +0000
Subject: Re: header,session stuff works on live fails on dev...?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-65450@lists.php.net to get a copy of this message
On Fri, 31 Aug 2001, Nic Skitt wrote: > Warning: Cannot add header information - headers already sent by (output > started at c:\apache\apache\htdocs\client-secure.php:11) in > c:\apache\apache\htdocs\client-secure.php on line 18 > > Which would indicate that the line 11 is sending output to the browser. Line > 11 is: > > $uid=$HTTP_SESSION_VARS["userid"]; > > How can this be sending an output? I also get this: The error you get isn't saying that line 11 is sending output; the error is saying that output was sent prior to line 11. You'll get the error if you have any code that sends output to STDOUT, or if you have any HTML or even whitespace before your opening PHP tag, and then try to send header data. (Once the browser starts getting the data your PHP script sends to STDOUT and other HTML and spaces, the browser has all the header data its going to use, and sending more is erroneous.) > Warning: Undefined index: userid in > c:\apache\apache\htdocs\client-secure.php on line 11 > Which would indicate that it cant find the session info. If it cant find it > does it write it? Make sure you registered userid as a session variable i.e. - session_register("userid"); And/Or make sure you make a call to session_start() before trying to check the session variable(s) if you registered the variable in another script and/or don't have session.auto_start set to 1. (http://www.php.net/manual/en/ref.session.php) ~Chris /"\ \ / Pine Ribbon Campaign Microsoft Security Specialist X Against Outlook The moron in Oxymoron. / \ http://www.thebackrow.net

« previous php.general (#65450) next »