Hi there. I hope you guys can help
This works on local host but once online it fails with "PHP Warning: session_start(): Cannot start session when headers already sent in /home/martinsb/public_html/switcher/switch.php on line 10"
Here is the nav part
<!---new code added for style switcher-->
Style is set to <?php echo $_SESSION["msg"];?><br/>
<a class="<?php echo $_SESSION['look0'];?>" href="switcher/switch.php?set=default">Default</a>
<a class="<?php echo $_SESSION['look1'];?>" href="switcher/switch.php?set=ada">ADA</a>
<a class="<?php echo $_SESSION['look2'];?>" href="switcher/switch.php?set=burrito">Burrito</a><br/>
<div style="font-size:12px; padding-top:8px; padding-bottom:10px;"><?php echo $_SESSION["why"];?></div>
<!--end switcher-->
Here is the switcher.php
<?php
$part= $_SERVER['HTTP_REFERER'];
$path_parts = pathinfo($part);
$result = $path_parts['basename'];
session_start();
?>
<?php
if( !isset($_GET['set'])){
echo "";
}
elseif ($_GET['set']=='default') {
$_SESSION["css"]="css/mysite.css";
$_SESSION["msg"]="Default";
}
elseif ($_GET['set']=='dark') {
$_SESSION["css"]="css/darkstyles.css";
$_SESSION["msg"]="Dark";
}
elseif($_GET['set']=='light') {
$_SESSION["css"]="css/lightstyles.css";
$_SESSION["msg"]="Light";
}
if ( !isset($SESSION["css"]) )
{$SESSION["css"]="css/mysite.css";
$_SESSION["msg"]="Default";
}
?>
<?php
// 301 Moved Permanently
header("Location: ../$result", true, 301);
exit();
?>