rjliquigan Posted November 22, 2009 Share Posted November 22, 2009 okay i wrote this first to enter a username to the database: $usercheck = $_POST['username']; $check = mysql_query("SELECT username FROM users WHERE username = '$usercheck'") or die(mysql_error()); $check2 = mysql_num_rows($check); everything works and writes perfectly to the database. Now i want to change it so instead of username it will be an email so i need to put special characters @ and "." so i used this: $usercheck = preg_replace("/[^a-zA-Z0-9s]/", "", $usercheck); it takes out the @ and "." but it wont write to any other tables. Please help, thank you so much! Link to comment https://forums.phpfreaks.com/topic/182454-help-please/ Share on other sites More sharing options...
Cardale Posted November 22, 2009 Share Posted November 22, 2009 I'm a little confused on what your trying to do. Link to comment https://forums.phpfreaks.com/topic/182454-help-please/#findComment-962905 Share on other sites More sharing options...
emopoops Posted November 22, 2009 Share Posted November 22, 2009 $emailtest = preg_match("/[^a-z,.\_ -@]/i", $email); if($emailtest == "1") {contains other characters than the ones specifieis int he prematch()... make them redo Link to comment https://forums.phpfreaks.com/topic/182454-help-please/#findComment-962989 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.