I have been scratching my head around this for a while. What i'm trying to do is redirect people to different pages based on the result of a survey. WHen i test it on my local computer it works perfectly and redirects the the appropriate page but when i put the code on my server, it stops working and just its on the page. There are nor errors logged in: Here is the code example:
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$data[0]= ($_GET['demo']);
$data[1]=$_GET['energy'];
$data[2]=$_GET['openness'];
$data[3]=$_GET['literacy'];
$meanenergy = $data[1] / 160;
$meanopenness = $data[2] / 16;
$meanliteracy = $data[3] /16;
if ($meanenergy <=0.5 && $meanopenness >0.5 && $meanliteracy <=0.5){
header("Location: http://domain/survey_result/Determined-Doer/");
}elseif ($meanenergy <=0.5 && $meanopenness >0.5 && $meanliteracy >=0.5){
header("location:http://domain/survey_result/Comfortable-Cruiser/");
} elseif ($meanenergy >=0.5 && $meanopenness >0.5 && $meanliteracy <=0.5){
header("location:http://domain/survey_result/Diligent-Planner/");
}elseif ($meanenergy >=0.5 && $meanopenness >0.5 && $meanliteracy >=0.5){
header("location:http://domain/survey_result/Financial-Freestyler/");
}elseif ($meanenergy <=0.5 && $meanopenness <0.5 && $meanliteracy <=0.5){
header("location:http://domain/survey_result/bold-adventurer/");
}elseif ($meanenergy <=0.5 && $meanopenness <0.5 && $meanliteracy >=0.5){
header("location:http://domain/survey_result/Energetic-Explorer/");
}elseif ($meanenergy >=0.5 && $meanopenness <0.5 && $meanliteracy <=0.5){
header("location:http://domain/survey_result/Sensible-Optimist/");
}else{
header("location:http://domain/survey_result/LaidBack-Observer/");
}
?>