$_session/$_cookie trouble

From: Date: Tue, 28 Apr 2009 14:48:19 +0000
Subject: $_session/$_cookie trouble
Groups: php.general 
Request: Send a blank email to php-general+get-292071@lists.php.net to get a copy of this message
I am trying to set a cookie and a session, but seem to be running into a wall. I have tried different variations, and keep getting the same error message If I have this <?php session_start(); I get this: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\weiss\assessresult.inc.php:2) in C:\xampp\htdocs\weiss\assessresult.inc.php on line 4 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\weiss\assessresult.inc.php:2) in C:\xampp\htdocs\weiss\assessresult.inc.php on line 4 If I have this: session_start(); setcookie('sale_cookie','$sale_value', time()-3600); setcookie('assess_cookie','$assess_value', time()-3600); I get this Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\weiss\assessresult.inc.php:2) in C:\xampp\htdocs\weiss\assessresult.inc.php on line 4 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\weiss\assessresult.inc.php:2) in C:\xampp\htdocs\weiss\assessresult.inc.php on line 4 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\weiss\assessresult.inc.php:2) in C:\xampp\htdocs\weiss\assessresult.inc.php on line 6 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\weiss\assessresult.inc.php:2) in C:\xampp\htdocs\weiss\assessresult.inc.php on line 7 If I delete and start over, I stll get the "headers already sent"... I have tried numerous other variations, but all with the same error. What am I missing here? Thanks Gary

« previous php.general (#292071) next »