If you place this just before your original code, it should work fine for now:
if(! isset($_GET['id']))
{// the id was not set, set it yourself with a default
$_GET['id'] = 0;
}
However, to make your function more portable, you should look at the function I sent you, and possibly use that instead (Without the need for the snipped in this post).
I cleaned your function a bit further, now looks like this:
function pf_validate_number($value, $function, $redirect)
{
if(isset($_GET[$value]))
{
if(! is_numeric($_GET[$value]))
{
header("Location: " . $redirect);
}
else
{
return($_GET[$value]);
}
}
else
{
if($function == 'redirect')
{
header("Location: " . $redirect);
}
else
{
return(0);
}
}
}
Just give both options a try and see what they do, and which you prefer