Jump to content

[SOLVED] input verification


nblackwood

Recommended Posts

if($_POST['field1'] != "") {
  // Let them continue
} else {
  // Give them the form back
}

Of course if they enter anything (even a space) into the input box, it'll allow them to continue...

 

[EDIT] Probably a better way of doing it would be something like:

 

$defaults = array(""," ","0","-");

if(!in_array($_POST['field1'],$defaults)) {
  // Allow user to continue
} else {
  // Give user the form again
}

Then you can just add as many options that you don't want people to be able to enter to the $defaults array as you like.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.