RE: [PHP-DB] why won't session_start() work?

From: Date: Thu, 28 Feb 2002 01:15:40 +0000
Subject: RE: [PHP-DB] why won't session_start() work?
Groups: php.db 
Request: Send a blank email to php-db+get-17338@lists.php.net to get a copy of this message
Ryan, you need to make all of those calls *before* ANY output has been sent by your script, otherwise you can't send a header any more. so the TOP of a script might look like <?php session_start(); $signor = $monsieur + $madame; session_register("signor"); // the rest of your code goes here ?> <html> <?php // more PHP ?> if you get what I mean. you can actually do a lot of coding before you start the session if you want, provided you haven't done any echo() print() or anything that sends information as output. HTH beau // -----Original Message----- // From: Ryan Snow [mailto:snow@cosmic.utah.edu] // Sent: Thursday, 28 February 2002 9:06 AM // To: php-db@lists.php.net // Subject: [PHP-DB] why won't session_start() work? // // // // when I do: // session_start(); // session_register('signor'); // session_register('username'); // // // I get: // // Warning: Cannot send session cookie - headers already sent // by (output // started at /var/www/html/index.php:3) in // /var/www/html/index.php on line 14 // // Warning: Cannot send session cache limiter - headers already // sent (output // started at /var/www/html/index.php:3) in // /var/www/html/index.php on line 14 // // Anybody know why? // // Thanks. // // Ry // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, visit: http://www.php.net/unsub.php //

« previous php.db (#17338) next »