
Originally Posted by
misson
That's not enough information to reproduce the problem. Create a
minimal test case, post the code here and include a link to a live version of the minimal test case.
For more on the syntax of the "Location" header, check the
current HTTP standard. Note that though the standard calls for an absolute URI, many browsers support
redirects to relative URIs.
i've already changed my codes and used the header once.. but it still not redirecting to the location i put in the header... it still stays on the same page.. BTW i'm creating an online examination.. here's my code..
PHP Code:
<?php
session_start();
include("config.php");
include("overall_assess.php");
include("course_specialty_function.php");
include("exam_assess_function.php");
$examid = $_SESSION['examid'];
$exam_score = $_SESSION['exam_score'];
$item_count = $_SESSION['item_count'];
$arith_score = $_SESSION['arith_score'];
$cler_score = $_SESSION['cler_score'];
$log_score= $_SESSION['log_score'];
$com_score = $_SESSION['com_score'];
$score_array = array($arith_score,$cler_score,$com_score,$log_score,);
$result = mysql_query("SELECT * FROM exam_result_tb WHERE username = '$_SESSION[username]'");
$count=mysql_num_rows($result);
$exam_no = $count;
if ($exam_score>$texam_good){
echo "Excellent";
$remark = "Excellent";
}
elseif ($exam_score>$texam_average&&$exam_score<=$texam_good){
echo "Good";
$remark = "Good";
}
elseif ($exam_score>$texam_fair&&$exam_score<=$texam_average){
echo "Average";
$remark = "Average";
}
elseif ($exam_score>$texam_poor&&$exam_score<=$texam_fair){
echo "Fair";
$remark = "Fair";
}
elseif ($exam_score>=0&&$exam_score<=$texam_poor){
echo "Poor";
$remark = "Poor";
}
include("config.php");
foreach($score_array as $each_remark){
if ($each_remark>=$logpass){
$score_remark[]="Good";}
elseif($each_remark<$logpass && $each_remark>=$logave){
$score_remark[]="Average";}
elseif($logave>$each_mark && $each_remark>="0"){
$score_remark[] = "Failed";}
}
$s_time = mysql_query("SELECT curtime FROM exam_result_tb WHERE examid = '$examid'");
$row = mysql_fetch_array($s_time);
$curtime = $row['curtime'];
$time_end = time();
$time_taken = $time_end - $curtime;
$time_took_min = "";
$time_took_sec = "";
$time_took_min = floor($time_taken/60);
$time_took_sec = ($time_taken`);
$tot_time_take = $time_took_min." minute(s),".$time_took_sec." second(s)";
mysql_query("UPDATE exam_result_tb SET time_taken='$tot_time_take',finish_time='$time_end',cler_score='$_SESSION[cler_score]',arith_score='$_SESSION[arith_score]',log_score='$_SESSION[log_score]',com_score='$_SESSION[com_score]',exam_score = '$_SESSION[exam_score]', t_exam = '$texam' , remark = '$remark',exam_no = '$exam_no' WHERE examid = '$examid'");
$username=$_SESSION['username'];
session_destroy();
session_start();
$_SESSION['time_end'] = $time_taken;
$_SESSION['qualification'] = $ave_cat_remarks;
$_SESSION['tot_time_take'] = $tot_time_take;
$_SESSION['score_array'] = $score_array;
$_SESSION['score_remark'] = $score_remark;
$_SESSION['texam'] = $texam;
$_SESSION['username'] = $username;
$_SESSION['exam_remark'] = $remark;
$_SESSION['exam_score'] = $exam_score;
$filename = "demo3.png";
unlink($filename);
header("Location:onlineitexam.x10.mx/online_ex_php/exam_result.php");
?>
any help and advice would be great.. thanks