Jump to content

[SOLVED] Simple Validation


phpretard

Recommended Posts

I do not want any special characters but spaces and capital Letters are OK

 

The code below is blocking spaces and capital letters I think

 

if (!preg_match('/^[^a-z0-9-_]+$/i',$docName)){
$error="<script>alert('The Document Name May Only Contain Letter And Numbers')</script>";
}

 

Any help?

Link to comment
https://forums.phpfreaks.com/topic/146251-solved-simple-validation/
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.