Help with form validation!
Moderator: General Moderators
Re: Help with form validation!
In PHP everything coming from the user is a string, so it'll always return true if you check it with is_string(). That isn't a problem though, because PHP variables are loosely typed - PHP will treat the value as number if it's a number when you use a mathematical function on it. So, in your case, so long as is_numeric() returns true you're fine. You don't need to check if it's a string or not.
Re: Help with form validation!
You should use isset() to make sure the post variables exists before checking if they're null.