View Full Version : Session Errors

10-04-2004, 08:54 PM
This is tha page with the errors (http://www.thecenterforadvancedlearning.org/~webdesign/tyler_vigeant/Store/store2.php)

I am getting the following errors:
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/webdesign/public_html/~~~/Store/store2.php:3) in /home/webdesign/public_html/~~~/Store/store2.php on line 4

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/webdesign/public_html/~~~/Store/store2.php:3) in /home/webdesign/public_html/~~~/Store/store2.php on line 4

I beleive the code that is generating this error is:

$Type = $_SESSION['Type'];
$Size = $_SESSION['Size'];
$Color = $_SESSION['Color'];
$fname = $_SESSION['fname'];
$lname = $_SESSION['lname'];
$email = $_SESSION['email'];
$phone1 = $_SESSION['phone1'];
$phone2 = $_SESSION['phone2'];
$phone3 = $_SESSION['phone3'];
$street = $_SESSION['street'];
$city = $_SESSION['city'];
$state = $_SESSION['state'];
$zip = $_SESSION['zip'];
$special = $_SESSION['special'];

What is it thats causing these errors? What can i do to fix it? Thanks.

10-04-2004, 09:07 PM
You must call session_start() before outputting anything at all. Solve this by putting session_start() on the very first line.

sir pannels
10-06-2004, 01:13 PM

Ok I can see that infact you do have the session start function there, however you have one single space before it.. that tiny space is making those nasty errors.. delete that and it will be good :)

10-06-2004, 04:13 PM
The space does nothing if it is inside php tags (<?php ... ?>)

Also, that space is put there by CF for some reason (probably to do with the php highlighting function.)