bengaltgrs Posted September 14, 2006 Share Posted September 14, 2006 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 Quote Link to comment Share on other sites More sharing options...
pkSML Posted September 14, 2006 Share Posted September 14, 2006 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><?phpecho $_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! Quote Link to comment Share on other sites More sharing options...
DaveLinger Posted September 14, 2006 Share Posted September 14, 2006 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.