Jump to content

Archived

This topic is now archived and is closed to further replies.

bengaltgrs

Textarea value

Recommended Posts

I am trying to post the value of a textarea from one page to another, using a standard form post to send it and the $_POST[] to retrieve it, then set a new textarea with that value.  It works fine except that for every instance of a newline, it will show up as a "br /", and I would rather have nothing show up at all, just the newline.  I am using "str_replace("br /", "", $Message)" to get rid of it, but that does not seem to do anything for some reason.  Is there any other way around this?

(imagine the "br /"'s have brackets on them)

-Chris

Share this post


Link to post
Share on other sites
Hmmm... Very interesting problem.

I tried this on my webserver and have no problems with the br tags.
The textarea on the second page looks perfect. The simple code I used was
[code]<textarea rows=20 cols=60>
<?php
echo $_POST['code'];
?>
</textarea>[/code] Note that I am using WinXP. It might make a difference if your server is using *nix.

Here is a test to see where the problem lies.
Save the contents of the posted data to a file. Examine the file for the annoying br tags. If they are not there, PHP seems to be the culprit. I'd take a close look at the php.ini file.

If all fails, save the posted data to a file, then retrieve the file to display in the textarea on the second page. It's odd, but it may work!

Share this post


Link to post
Share on other sites
the code you have POSTing the data is using a function (n2blr i believe) which changes line breaks into html line breaks. Dunno how to get around it.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.