View Single Post
Old 06-26-2012, 02:44 PM   PM User | #1
jeffshead
New Coder

 
Join Date: Oct 2008
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
jeffshead is an unknown quantity at this point
PHP - Allow only one particular word or any number

I am trying to edit a script to add some functionality.

I want to check a form input field and throw an error if it's blank or if it contains anything other than the word "Unlimited" or a number.

Here's a snippit but I know it's not correct:

PHP Code:
$use $_POST['uses'];
if (!
$edtErr) {
if ((!
$use)||($use!="Unlimited")&&(!ctype_digit($use)) {                         
$edtErr true;                  

Anyone care to help me fix this
jeffshead is offline   Reply With Quote