I am trying to input data using forms into the MySQL, and also using mysql_real_escape_string
for this purpose. Unfortunately I am having a problem with the output. It displays \
s, or if I use stripslashes
then it removes all slashes.
If I submit web's forms using backslash \
I get this output:
"web\'s forms using backslash \\"
See I got a double backslash. But if I use the stripslashes
function then it removes all slashes but also removes inputed slash and the output is
"web's forms using backslash"
Here, no backslash is displayed, but there should be one backslash at the end.
The problem is that if someone uses backslash in password field and any other filed, then the backslash will be stripped or displayed twice.And also please tell me what is best for displaying output htmlentities or htmlspecialchars