HELP!!! - problem with starting sessions!! [SOLVED]
Posted: Thu May 07, 2009 5:20 pm
Hi guys am in need of some help
I have been working on a website that works perfectly on my server, but now doesnt work on my clients server!!!
This should just start the session and then check if the variable exists and then should redirect the user if it doesnt exist.
It is throwing up the error:
I dont understand why it works on one server and not the other :s
Any help would be great thanks
I have been working on a website that works perfectly on my server, but now doesnt work on my clients server!!!
Code: Select all
<?
session_start();
if(!$_SESSION['select']){
$url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
// Check for a trailing slash.
if ((substr($url, -1) == '/') OR (substr($url, -1) == '\\') ) {
$url = substr ($url, 0, -1); // Chop off the slash.
}
// Add the page.
$url .= '/splash.php';
header("Location: $url");
exit(); //quit script
}
if($_SESSION['select']== 'trade'){
$set_p= "t";
}
if($_SESSION['select']== 'retail'){
$set_p= "r";
}
?>
It is throwing up the error:
Code: Select all
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/joan3252/public_html/splash.php:8) in /home/joan3252/public_html/splash.php on line 14
Warning: Cannot modify header information - headers already sent by (output started at /home/joan3252/public_html/splash.php:8) in /home/joan3252/public_html/splash.php on line 27
Any help would be great thanks