[!--quoteo(post=221163:date=Apr 3 2005, 05:10 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Apr 3 2005, 05:10 PM)
Just a note: If you are trying to add them to a text field, use
[a href=\"http://www.php.net/htmlspecialchars\" target=\"_blank\"]htmlspecialchars[/a] and [a href=\"http://www.php.net/htmlentities\" target=\"_blank\"]htmlentities[/a] to convert the single and double quotes.
This is exactly what I'm trying to do. Here is the situation...
Page one...Form Field for user to enter data. This data may have single quote, double quote, no quote or both quote marks. I have magic_quotes off in my PHP.ini file and on the insert page I'm using addslashes() around the $_POST[item].
The data is being entered into the database correctly, but when I bring the data back to be displayed in the form field, it drops anything after the single quote mark. I've tried adding htmlspecialchars() and htmlentities, but niether are working. I'm adding htmlentities() around the data I receive from my select statement before I try and display it in a form text box.
BTW...I'm using PHP 5.1.2, Apache2 and MySQL 5.0.15
Please help! I'm pulling my hair out and I don't have much left to start with.