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

Reply via email to