Reputation: 497
If I input into mysql
htmlspecialchars("test'ed", ENT_QUOTES, 'UTF-8')
its stored as test'ed.
If I use
htmlspecialchars( $_POST["txtfirstname"], ENT_QUOTES, 'UTF-8')
its stored as test/'d
Whats the deal with the slash when using posted data?
Upvotes: 1
Views: 151
Reputation: 6348
Turn off magic quotes, or use stripslashes. the slash is being inserted for you.
http://php.net/manual/en/function.stripslashes.php
Upvotes: 5