Jump to content

Textarea value


bengaltgrs

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
Link to comment
https://forums.phpfreaks.com/topic/20679-textarea-value/
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!
Link to comment
https://forums.phpfreaks.com/topic/20679-textarea-value/#findComment-91470
Share on other sites

Archived

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

×
×
  • Create New...

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.