note 50106 added to function.session-start

From: Date: Fri, 18 Feb 2005 06:45:49 +0000
Subject: note 50106 added to function.session-start
Groups: php.notes 
Request: Send a blank email to php-notes+get-85193@lists.php.net to get a copy of this message
Other users have mentioned rogue spaces at the beginning of includes tripping up headers, but you should also beware of spaces at the END of an included file. To illustrate - I keep mySQL username and password details in a single file called my.php which I include wherever it's required. It was working fine in most pages but causing a 'headers already sent' error whenever header("Location: blah.php"); was called. The solution was to remove invisible spaces from the end of the included my.php file - ie AFTER the ?> ---- Manual Page -- http://www.php.net/manual/en/function.session-start.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+50106 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50106&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50106&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50106&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50106&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50106&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+50106&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#85193) next »