PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 18th, 2002, 05:18 PM
Yoni Yoni is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 6 Yoni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
help with php and textarea

hi
I have this code:
PHP Code:
<?php
if(!$mes)
{
?>
<form method="post">
<textarea name="mes" cols=10 rows=10></textarea>
<input type="submit" value="send">
</form>
<?php
}
else
{
 
$messtr_replace('\n','',$mes);
 echo
"$mes";
}
?>


and I am trying to show what I type in the textarea on the screen.

The thing is that I that what I am writing in the textarea to appear in the source of the code in one line even if I am writing more when one line.

As you can see I tried replacing the \n charter white nothing but it didn't work.

Dose someone have an idea?

Thanks.

Reply With Quote
  #2  
Old May 18th, 2002, 07:51 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
add this line

global $mes;

i tryed your code, even without that line it worked for me

Reply With Quote
  #3  
Old May 18th, 2002, 08:13 PM
mytch mytch is offline
Dev Articles Novice (500 - 999 posts)
 
Join Date: Apr 2002
Location: Sydney, Australia
Posts: 588 mytch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
If you're using PHP v4.1+, then replace $mes with $_POST["mes"]... maybe your PHP ini settings or somethnig... but yeah, as ben said, that code should work fine...

Reply With Quote
  #4  
Old May 19th, 2002, 05:58 AM
Yoni Yoni is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 6 Yoni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You misunderstood me.

The code works fine but it doesn’t do what I need.

For example:

If I will write in the textarea-

Hello

how are you?

It will appear in the source of the page in three line
but I want it to appear in the source like this:

Hello how are you?


how can I do that?

Reply With Quote
  #5  
Old May 20th, 2002, 04:37 AM
Yoni Yoni is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 6 Yoni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I got the answer.

I need to replace the \r\n

thanks any way.

Reply With Quote
  #6  
Old May 20th, 2002, 06:03 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
what does the \r do???

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > help with php and textarea


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap