[PHP] StripSlashes() quotes in text boxes
Hi, I have had a few problems retrieving MySql entries that contain quote marks. Slashes have been added before storing an item description such as: 17 SVGA Monitor. They've been removed before display too - and the description appears correctly on a page except when displaying in a text box (for an administrator to edit the item description. When displayed in a text box the description just shows 17. The only solution I can find is to swap the quote marks for quot; when storing the item initially and when any update has been submitted by the user. Is this the best way, and are there any other characters waiting to cause the same problem that I don't know about yet? Thanks, Robert MacCombe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] StripSlashes() quotes in text boxes
Hi Robert, administrator to edit the item description. When displayed in a text box the description just shows 17. The only solution I can find is to swap the quote marks for quot; when storing the item initially you can use htmlspecialchars() function to convet all the html chars. The issue is, when do you convert it, either when you want to display them on browser, or when user INSERT/UPDATE. I think it's better to convert it only when displaying to the browser. so in the DB, the data is still stored as it is, because you might want to display the data somewhere else other than browser, for example email or printing. -- Jimmy All work and no pay makes a housewife. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]