hi can anyone tell me why doesnt my page redirect if variable $Valid is = 0
thanks
also if you could correct me would be appreciated
<?php
$name = $_POST['Name'];
$age = $_POST['Age'];
$amount = $_POST['Cover'];
$plan = $_POST['Plan'];
$benefit = $_POST['Benefit'];
$Year = DetYear($plan);
$Valid = ChkAge($age, $Year);
$redirect = "QuoteAgeError.html";
if ($Valid == 0){
header($redirect);
}
function DetYear($p) {
if ($p == 1){
return 10;
}
else if ($p == 2){
return 15;
}
else if ($p == 3){
return 20;
}
else if ($p == 4){
return 25;
}
else if ($p == 5){
return $_POST['Year'];
}
}
function ChkAge($a,$y) {
$t = $a + $y;
if ($t > 60){
return 0;
}
else return 1;
}
?>