Re: my bugaboo.

From: Date: Sun, 04 Feb 2001 09:37:27 +0000
Subject: Re: my bugaboo.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38086@lists.php.net to get a copy of this message
I had a problem similar to this myself a while ago... I don't believe the issue is with the differing versions of PHP, but rather with the improper escaping of the quote characters. There are two PHP functions: addslashes() and stripslashes() Call the former when you submit the information to properly escape the characters that need it, something like: $new_data = addslashes($old_data); should work... then when you go to display the information, call stripslashes to de-escape everything: $display_str = stripslashes($new_data); I hope this helps. -Matt At 06:42 PM 2/3/2001, you wrote:
Hi.. I have a routine where we input text to fields. When there is an apostrophe it handles it correctly. When the form is brought back for editing, the field values show up in the input fields, with all apostrophes intact, just as it should be. When I upload this script to my isp, it doesn't work.. The apostrophes truncate the rest of the text. 'Don't cry over spilled milk', in a field, turns into 'Don'... I have php4 mod in my win32 devbox. The isp is php3. Is this the problem? What is the best way out of it please? Thanks in advance. Floyd


« previous php.general (#38086) next »