[PHP] RE: How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Eric
if(preg_match('(.*)^[A-Za-z0-9]+', $_POST['username']) !== 0) { echo p style=\color:red;font-weight:bold;margin-left:95px\; echo Username must only contain A-Z and 0-9/p; include(register.html); exit; } I used the code above but I now get this error message Warning: preg_match()

Re: [PHP] RE: How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Marco Lanzotti
Il 22/09/2011 17:54, Eric ha scritto: if(preg_match('(.*)^[A-Za-z0-9]+', $_POST['username']) !== 0) { Whi this '(.*)'? For '.' and '..' problem use is_file(). Bye, Marco -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Shawn McKenzie
On 09/22/2011 10:54 AM, Eric wrote: if(preg_match('(.*)^[A-Za-z0-9]+', $_POST['username']) !== 0) { echo p style=\color:red;font-weight:bold;margin-left:95px\; echo Username must only contain A-Z and 0-9/p; include(register.html); exit; } I used the code above but I now

Re: [PHP] RE: How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Nilesh Govindarajan
On 09/22/2011 09:24 PM, Eric wrote: if(preg_match('(.*)^[A-Za-z0-9]+', $_POST['username']) !== 0) { echo p style=\color:red;font-weight:bold;margin-left:95px\; echo Username must only contain A-Z and 0-9/p; include(register.html); exit; } I used the code above but I now