Reputation: 379
I have a form that asks for a name. The php to process it is:
$name = mysqli_real_escape_string($dbc, trim($_POST['name']));
When someone inserts a name with an apostrophe e.g. Dan O'Shea it shows up in the mysql database fine, but on the webpage it's output shows up as Dan O\Shea.
How do I get rid of the \ backslash and show the ' apostrophe on the webpage? Can I use str_replace('/','', $string) with mysqli_real_escape_string, and if so how?
Thanks for any help,
Andy ;-)
Upvotes: 0
Views: 47
Reputation: 93676
Sounds like you have gpc_magic_quotes
turned on.
http://php.net/manual/en/security.magicquotes.php
Upvotes: 0