Re: [PHP] textarea -- what happens to my new lines

2001-05-03 Thread heinisch

At 13:10 03.05.01 +0200, you wrote:

I am making a e-card page, and I am having a problem with with my message
box which is a textarea when I am previewing or saving/recalling the text
all the newline characters are gone. Any good ideas!

Thanks
Lars Stampe

Try
textarea name=foo rows=10 cols=50 wrap=physical/textarea
this make hard LF´s

Oliver



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] textarea -- what happens to my new lines

2001-05-03 Thread Stampe, Lars

Thanks for the idea, it didn't work, let me just explain a bit further!

this is a simple version of the code


input.htm::

form name=form method=get action=show.php
  textarea name=textfield cols=45 rows=5 wrap=HARD/textarea
  p
  input type=submit name=Submit value=Submit
/form

show.php::

?php
echo $textfield;
?



When I put in :

1
2
3
4

I get:

1 2 3 4

how do I fix this ( want it to appear like it was typed!)?

Regards
Lars Stampe




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 03 May 2001 12:44
To: Stampe, Lars; [EMAIL PROTECTED]
Subject: Re: [PHP] textarea -- what happens to my new lines


At 13:10 03.05.01 +0200, you wrote:

I am making a e-card page, and I am having a problem with with my message
box which is a textarea when I am previewing or saving/recalling the text
all the newline characters are gone. Any good ideas!

Thanks
Lars Stampe

Try
textarea name=foo rows=10 cols=50 wrap=physical/textarea
this make hard LF´s

Oliver



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] textarea -- what happens to my new lines

2001-05-03 Thread elias

okay,...now that you showed some code...
basically, when you input via textarea all new lines are in the string
like \n
so to display them correctly in show.php do like:
pre
?=$lines?
/pre
basically, in HTML the '\n' doesn't show you a new line,
or else you can replace all the '\n' with 'br' tag!

-elias
www.eassoft.cjb.net

Stampe, Lars [EMAIL PROTECTED] wrote in message
06D1C9FA1087D4119FC900508B95056E768ABF@eulexch1a">news:06D1C9FA1087D4119FC900508B95056E768ABF@eulexch1a...
Thanks for the idea, it didn't work, let me just explain a bit further!

this is a simple version of the code


input.htm::

form name=form method=get action=show.php
  textarea name=textfield cols=45 rows=5 wrap=HARD/textarea
  p
  input type=submit name=Submit value=Submit
/form

show.php::

?php
echo $textfield;
?



When I put in :

1
2
3
4

I get:

1 2 3 4

how do I fix this ( want it to appear like it was typed!)?

Regards
Lars Stampe




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 03 May 2001 12:44
To: Stampe, Lars; [EMAIL PROTECTED]
Subject: Re: [PHP] textarea -- what happens to my new lines


At 13:10 03.05.01 +0200, you wrote:

I am making a e-card page, and I am having a problem with with my message
box which is a textarea when I am previewing or saving/recalling the text
all the newline characters are gone. Any good ideas!

Thanks
Lars Stampe

Try
textarea name=foo rows=10 cols=50 wrap=physical/textarea
this make hard LF´s

Oliver



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] textarea -- what happens to my new lines

2001-05-03 Thread Jon Haworth

Try this:

?php
$textfield = nl2br($textfield);
echo $textfield;
?

For more info, have a look at http://www.php.net/nl2br.

HTH
Jon


-Original Message-
From: Stampe, Lars [mailto:[EMAIL PROTECTED]]
Sent: 03 May 2001 13:35
To: [EMAIL PROTECTED]
Subject: RE: [PHP] textarea -- what happens to my new lines


Thanks for the idea, it didn't work, let me just explain a bit further!

this is a simple version of the code


input.htm::

form name=form method=get action=show.php
  textarea name=textfield cols=45 rows=5 wrap=HARD/textarea
  p
  input type=submit name=Submit value=Submit
/form

show.php::

?php
echo $textfield;
?



When I put in :

1
2
3
4

I get:

1 2 3 4

how do I fix this ( want it to appear like it was typed!)?

Regards
Lars Stampe


**
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or confidentiality'

**

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] textarea -- what happens to my new lines

2001-05-03 Thread heinisch

At 14:34 03.05.01 +0200, you wrote:

change wrap !
textarea name=textfield cols=45 rows=5 wrap=physical/textarea
physical means pyhsical not HARD

echo nl2br($textfield); //turns your nl´s in br´s

That should work
Oliver


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]