Jump to content

Text Box Breaks?


Recommended Posts

i have a simple code that echo's text within a textbox after submit.

but it just puts it all together, it dosn't keep the lines! like if the person pressed "Enter" like 4 times it wouldn't matter, it just puts it into 1 jumble. how do i fix that?

 

<form method="post">
<textarea id="text1" name="text1" rows="10" cols="30"></textarea>
<input name="add" type="submit" id="add" value="Add">
</form>

<?php
if(isset($_POST['add']))
{

$text1 = $_POST['text1'];
$text2 = htmlentities($text1);

echo $text2;
}
?>

Link to comment
https://forums.phpfreaks.com/topic/41043-text-box-breaks/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.