How can I allow users to use `` '' (double quotation mark) inside the text box ...
Whenever I use a double quote in a field (value), then when I receive a variable in my PHP file:
$text=mysql_real_escape_string($_POST['subject']);
and then repeat it, I get a string that is escaped properly, but the string stops exactly before the double quote!
I don't want him to stop due to a double quote, though!
Javascript is used to validate a text field, so it is not empty, maybe I should do something else with javascript when checking and changing the value so that php can get the correct value, including double quotes?
thanks
UPDATE
CODE:
$headline= mysql_real_escape_string($_POST['headline']); echo htmlentities($headline);
I tried to merge the two above, will give only the same results. NOTE. I ALSO TRIED adds ENT_QUOTES to the htmlentities function ...
Unformatted string entered:
+ , . ; : - _ space & % ! ? =
prints this when it repeats:
+ , . ; : - _ space & % ! ? = # * ½ @ / \\ [ ]< >
javascript html php
user188962
source share