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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.