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); Link to comment https://forums.phpfreaks.com/topic/182453-need-help-email/ 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? Link to comment https://forums.phpfreaks.com/topic/182453-need-help-email/#findComment-964403 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.