Jump to content

[SOLVED] easy server side validation question


carley_bell

Recommended Posts

Hi...again,

I know this is probably really easy but...

I am trying to validate my form and cannot figure out how to make sure field_1 is only alphanumeric. This is what I have attempted so far (please don't laugh)

 

$alnum = !ereg("^[A-z0-9]*$");
// make sure both email addresses match
if ($_POST['field_7'] != $_POST['field_8']) {
die('The email addresses you entered do not match. Please use your browsers back button to go back to the form ');
}
// make sure userid is alphanumeric
if ($_POST[$alnum . 'field_1']) {
die('User ID should not contain any spaces or special characters. Please use your browsers back button to go back to the form ');
}

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.