Hi,
I'm trying to check if the user_id is set, and if it's a number instead of a letter. If any of these 2 fail it should redirect the page back to the index.
This works for the first part, if the user_id is not in the url you are going back to the index. But when i enter a letter instead of a number it only comes up with an error. I try'd the is_numeric check seperately and this works fine, but i can't get it to work together.
Any suggestions how to fix it, or a better way to make sure the user_id is a number and does exist in the url.
Code:if(!isset($_GET['user_id']) && (!is_numeric($_GET['user_id']))) { header ("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php"); }





Bookmarks