Forum Moderators: coopster

Message Too Old, No Replies

php html help need

i have some problem with html

         

kaleelkr

11:05 am on Feb 20, 2009 (gmt 0)

10+ Year Member



Hi i am start up web developer
i have some problem with html
i just create one simple program to pass value text area to another page using php. when i type in text area like this

hellooo
.
.
.
.
.
hi

this is displaying in html like this :

hellooo.....hi

not braking line. how i display in html page text as textarea value
my first page code :
-------------------
<form id="form1" name="form1" method="post" action="show.php">
<label>
<textarea name="txt1" id="txt1"></textarea>
</label>
</form>
---------------------
action page code
---------------------
<?php
$value = $_REQUEST['txt1'];
echo $value;

?>
----------------------

barns101

1:14 pm on Feb 20, 2009 (gmt 0)

10+ Year Member



When displaying text like that in an HTML page you need to convert the new lines to breaks using nl2br() [php.net].

Also remember that for security reasons you should not trust user input and so you'd want to validate the data before displaying it.