Jump to content

validate help


speedy33417

Recommended Posts

I have a little problem validating a user entry

Here's the code:

[code]if (preg_match('![a-z0-9\-_]+!',$albumName)) {
  //passed
  $message = "passed";
} else {
  // failed
  $message = "did not pass";   
}
[/code]

The code should only accept a-z0-9 dash and underscore.

For some reason it only checks the first letter and user entry such as a@#$ slip through. What am I doing wrong?
Link to comment
https://forums.phpfreaks.com/topic/27019-validate-help/
Share on other sites

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.