Jump to content

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 ');
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.