Re: posting text that contains a '
| From: | Justin French | Date: | Mon, 05 Aug 2002 03:47:43 +0000 |
| Subject: | Re: posting text that contains a ' | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-111129@lists.php.net to get a copy of this message | ||
There's a few magic quotes directives in the php.ini which *may* have been
changed or had different defaults on a recent upgrade, which may explain the
recent problem -- check out the settings with PHP info, and then read up in
the manual or php.ini comments to decide what settings you want.
I prefer to leave them as they are for you right now, and instead of
preg_repalce, use strip_slashes() [or is it stripslashes()??] to strip out
the slashes.
<TEXTAREA name="foo"><?=strip_slashes($myText)?></TEXTAREA>
<INPUT type="text" name="foo2"
value="<?=strip_slashes($myText)?>">
Lemme know if you need more help.
Justin French
on 05/08/02 1:41 PM, Police Trainee (policetrainee@yahoo.com) wrote:
> I've recently noticed that when i post text from a
> textarea field to a text file that ' (single quotes)
> are written as /'
> if i have the textarea field include the text that was
> posted to the file, it displays /' for all the single
> quotes. if i post the textarea field again, it posts
> the /' as //'. this cycle continues endlessly.
>
> I have compensated for this by sending the output
> through a preg_replace to get rid of all the
> backslashes.
>
> The reason I am writing is because this entire problem
> has only started happening recently. I used to be able
> to post textarea field data and recall it back into
> the textarea field verbatim character per character.
> What is causing this to change?
>
> I am running apache 1.3.20 on a linux system with php 4.2.1
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com