phpretard Posted February 21, 2009 Share Posted February 21, 2009 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? Quote Link to comment Share on other sites More sharing options...
only one Posted February 21, 2009 Share Posted February 21, 2009 preg_match('/^[a-zA-Z0-9_- ]+$/i', $docName) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.