Wednesday, June 27, 2018

php - A set of valid characters for web site passwords



Hi I was composing a regex for a password field of my site and had a concern:



Are there any characters I should block a user from entering? If so why?



Or is it enough just to escape dangerous characters like = and ' when processing data?
It seems good for this topic to list the php functions for escaping those, if you would.




Thanks!


Answer



I hash anything a user enters as a password, so I don't care what they enter, it never touches my database and can't cause any harm. md5($_POST['password'])



Other fields are a different story...



mysql_real_escape_string() is a great function for escaping data in queries.


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...