Re: stripslashes()
| From: | Dade Register | Date: | Sun, 02 Mar 2003 02:37:38 +0000 |
| Subject: | Re: stripslashes() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-137743@lists.php.net to get a copy of this message | ||
I know I am doing the exact thing you are.... If you
or someone else doesn't mind, could you look @
http://dragonz-cavern.mine.nu/poems.phps and
see what
I'm doing wrong? I am trying to parse it before it
gets stored in my txt file. plz help. I'd really
appreciate it.
-Dade
--- Ernest E Vogelsinger <ernest@vogelsinger.at>
wrote:
> At 02:05 02.03.2003, Dade Register said:
> --------------------[snip]--------------------
> >Well, only diff is it's a POST from a textarea.
> With
> >magicquotes on, you're right, it makes "Thank's"
> >become "Thank\'s". how can I get rid of that? I'm
> >posting it to a text file.
> --------------------[snip]--------------------
>
> Use stripslashes().
>
> Try this example:
>
> <?php
>
> $var = $_REQUEST['blah'];
> echo '<xmp>$REQUEST[\'blah\']: "', $var, "\"\n";
> $var = stripslashes($var);
> echo 'stripslashe\'d: "', $var, '"</xmp>';
> echo '<form method="post">',
> '<textarea name="blah">',
> $var,
> '</textarea><br />',
> '<input type="submit"></form>';
>
> ?>
>
> You will notice the textarea transmits "Thank\'s"
> which is displayed in the
> first line, and stripslashes() removes the backslash
> and displays "Thank's".
>
> Note that you also must use the stripslashe'd data
> when constructing the
> textarea.
>
>
> --
> >O Ernest E. Vogelsinger
> (\) ICQ #13394035
> ^ http://www.vogelsinger.at/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/