I have php configured so that is automatically creates slashes before single quote or double quotes in strings that are passed from page to page.
When I try to insert a string into MySql dbase, the single quotes will insert fine, but at the first double quote the string terminates and isn't saved into the dbase.
I would like to be able to html encode my strings so that double quotes are saved into the dbase as:
"
I have tried using the below code but it does not convert quote symbols.
<?php
$new = htmlspecialchars($var, ENT_QUOTES);
echo $new;
?>
Can someone advise me how to achieve this?[