Ive been trying to figure out a solution to this problem for hours but i cant figure it out. i think it may be a bug, but its driving me crazy. code is below with an explanation at the source of the problem.
// check to see if var ‘m’ is of valid syntax and a proper month
if(isset($_GET[‘m’])) {
$validMonths=range(1, 12);
if(!in_array($
// not a valid month
header(‘Location: home.php’);
}
}
// check to see if var ‘y’ is of valid syntax
if(isset($_GET[‘y’])) {
// here is where it messes up. if the below statement is ‘true’, php for some reason skips the header() and continues. the problem with it continuing is that when it gets to the condition to check if the $
if(!is_numeric($_GET[‘y’])) {
header(‘Location: home.php’);
}
// check to see if @param ‘y’ is a proper month
$validYear=range(2008-5, 2008+5);
if(!in_array($_GET[‘y’], $validYear)) {
if($_GET[‘y’]<(2008-5)) {
// to far in the past
header(‘Location: home.php?c=1&m=1&y=’.($_GET[‘y’]+1).’&msg=1′);
} else {
// to far in the future
header(‘Location: home.php?c=1&m=12&y=’.($_GET[‘y’]-1).’&msg=1′);
}
}
}