Anyone know the problem with this snippit. I am trying to make sure that the value $pwd1 contains only letters and numbers.
if (preg_match ("/[a-z0-9]+S/", $pwd1)) { // code here }
Thanks,
David
This was probably just a careless mistake, but if you replace the "S" with "$", it should work.
Still giving me problems.
Here is my code
if (preg_match ("/[a-z0-9]+$/", $pwd1)) { $errormsg .= "<LI>INVALID PASSWORD: Password may contain only letters or numbers.\n";
}
Interesting. I did not think that I could post html code to this board. <LI > and <BR > were accepted above.
The code you use now is sort of backward.
change "(preg_match ("/[a-z0-9]+$/", $pwd1))" to "if (!ereg_match ("/[a-z0-9]+$/", $pwd1)) {", and it should work properly. If not, I don't know what the problem is.