Jump to content


Photo

Textarea value


  • Please log in to reply
2 replies to this topic

#1 bengaltgrs

bengaltgrs
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 14 September 2006 - 01:42 AM

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

#2 pkSML

pkSML
  • Members
  • PipPipPip
  • Advanced Member
  • 191 posts
  • LocationBucyrus, Ohio

Posted 14 September 2006 - 02:00 AM

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
<textarea rows=20 cols=60>
<?php
echo $_POST['code'];
?>
</textarea>
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!
-Stephen

Need a LitlURL?

Got code to share? --> The Code-Bin

#3 DaveLinger

DaveLinger
  • Members
  • PipPipPip
  • Advanced Member
  • 268 posts
  • LocationWV, USA

Posted 14 September 2006 - 02:11 AM

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.
http://www.DaveLinger.com
dave at linger dot com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users