...

View Full Version : Stopping <textarea> from espcaping quotes



me'
12-22-2003, 08:54 PM
I'm trying to build a simple CMS, and I have the following code for the textarea:
<textarea name="post" rows="10" cols="50" tabindex="2"></textarea>The problem is, I can access the data it posts and everything is well, except normally I'm echoing it straight back into HTML, which means that the backslashes that the textarea presumably automattically puts in there show up as backslashes. HTML doesn't need you to escape ' or ", so how do you stop the textarea from doing it automatically?

Nightfire
12-22-2003, 09:01 PM
http://www.php.net/stripslashes :)



<textarea name="post" rows="10" cols="50" tabindex="2">
<?php
echo stripslashes($str);
?>
</textarea>

Sometimes you might have to do


<textarea name="post" rows="10" cols="50" tabindex="2">
<?php
echo stripslashes(stripslashes($str));
?>
</textarea>

me'
12-22-2003, 10:34 PM
Heh, should have looked for something like that before I posted, I guess.

Thanks for the help :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum