hariskar Posted November 14, 2016 Share Posted November 14, 2016 (edited) In a member register form how can I add a validation rule to allow only latin characters for username and password? Today a member registered and put in Greek characters and the result in mysql is Σοφία ΔÎδε ... (In mysql collation is utf8_general_ci). How can I avoid this? Thank you! Edited November 14, 2016 by hariskar Link to comment Share on other sites More sharing options...
justsomeguy Posted November 14, 2016 Share Posted November 14, 2016 I believe that a regular expression that checks for the normal letters and whatever other characters you want to allow will work, although there's definitely a way to have your site support Unicode correctly. Link to comment Share on other sites More sharing options...
hariskar Posted November 15, 2016 Author Share Posted November 15, 2016 I added $db->exec("SET NAMES 'utf8';"); in php and now usernames are stored correctly in mysql. Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now