php conditional
by Neil Bradley
on
Oct 13, 2008 at 10:43:23 pm
Working on a form containing conditional rejoins in php.
I am using is_numeric to test if the form contains a number value however not sure what to use to the is the value contains characters.
Re: php conditional by Neil Bradley on Oct 14, 2008 at 9:32:57 pm
The code I am using for a similar form processing only numbers is:
if (!(is_numeric($_POST['mobile']))
header("Location: register.php?error=notnumeric");
exit;
}
This code figures out that there are no numbers being sent via the form and returns a message back to the form saying "display my hidden message".
I see how your code works but unsue how to insert it into my own code. How would I adapt your code here:
Just for fun this time if I wanted to check to see if the form contained any characters or any numbers (basically an entry of any number or character combination) how would this affect the code configuration?