rjliquigan Posted November 22, 2009 Share Posted November 22, 2009 Hi all, I'm having problems with writing @ and "." I'm having a user name as their email address but its not working properly, if i dont use speacial characters it works fine. So i used a string to pull out the @ . sign but it doesnt work right. Hopefully someone here can help. heres what i got: $usercheck = $_POST['username']; $usercheck = preg_replace("/[^a-zA-Z0-9s]/", "", $usercheck); $check = mysql_query("SELECT username FROM users WHERE username = '$usercheck'") or die(mysql_error()); $check2 = mysql_num_rows($check); Quote Link to comment Share on other sites More sharing options...
Coreye Posted November 24, 2009 Share Posted November 24, 2009 Hi all, I'm having problems with writing @ and "." I'm having a user name as their email address but its not working properly, if i dont use speacial characters it works fine. So i used a string to pull out the @ . sign but it doesnt work right. Hopefully someone here can help. heres what i got: $usercheck = $_POST['username']; $usercheck = preg_replace("/[^a-zA-Z0-9s]/", "", $usercheck); $check = mysql_query("SELECT username FROM users WHERE username = '$usercheck'") or die(mysql_error()); $check2 = mysql_num_rows($check); I tried your code with special characters and it worked fine. What problems are you having with it? 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.