Re: slash trouble when editing text
| From: | Matt Palermo | Date: | Wed, 11 Jun 2003 20:43:37 +0000 |
| Subject: | Re: slash trouble when editing text | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151142@lists.php.net to get a copy of this message | ||
Will the stripslashes() remove the slashes that are supposed to be in the
file? Because often times there are slashes in the file that need to be
there.
Matt
----- Original Message -----
From: "CPT John W. Holmes" <holmes072000@charter.net>
To: "Matt Palermo" <mpalermo@vt.edu>; <php-general@lists.php.net>
Sent: Wednesday, June 11, 2003 4:42 PM
Subject: Re: [PHP] slash trouble when editing text
> Use stripslashes() to remove the slashes. Use htmlentities() on the text
> before you put it into the <textarea>, also.
>
> ---John Holmes...
>
> ----- Original Message -----
> From: "Matt Palermo" <mpalermo@vt.edu>
> To: <php-general@lists.php.net>
> Sent: Wednesday, June 11, 2003 4:16 PM
> Subject: [PHP] slash trouble when editing text
>
>
> I wrote a small script that creates a link to all the .php and .txt files
in
> a given directory. When one of these links is clicked, it brings up
another
> window with the files contents inserted into a text area. From there the
> user can edit the text file then click a submit button to make the
changes.
> The problem is whenever the file contains quotes, when the file gets
edited
> it puts a slash in front of every quote. Like this.
>
> // original .txt file
> "these are quotes"
>
> Then when the submit buttons is clicked, the file looks like this:
>
> // edited .txt file
> \"these are quotes\"
>
> If submit is pressed again, then it will look like this:
>
> // twice edited file
> \\"these are quotes\\"
>
> Does anyone know how I can avoid this from happening? Thanks.
>
> Matt
>