Menu
[i](Hmmm…that’s weird: how did my reply end up before the original post?)
I might do that part as:
[code=php]
$month = intval($month);
if($month < 1 or $month > 12) {
// display/log error or whatever you want to do in this case
}
else {
$monthName = array(1 => ‘january’, ‘february’, ‘march’, ‘april’, ‘may’,
‘june’, ‘july’, ‘august’, ‘september’, ‘october’, ‘novemeber’, ‘december’);
$location = sprintf(“http://example.com/%02d-%s.php”, $month, $monthName[$month]);
if(!headers_sent()) {
header(“Location: $location”);
exit;
}
else {
// display/log error or whatever you want to do in this case
}
}