[email protected] Posted March 3, 2007 Share Posted March 3, 2007 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 More sharing options...
genericnumber1 Posted March 3, 2007 Share Posted March 3, 2007 <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 = nl2br($_POST['text1']); $text2 = htmlentities($text1); echo $text2; } ?> Link to comment https://forums.phpfreaks.com/topic/41043-text-box-breaks/#findComment-198751 Share on other sites More sharing options...
[email protected] Posted March 3, 2007 Author Share Posted March 3, 2007 Awesome THANKS!!! Link to comment https://forums.phpfreaks.com/topic/41043-text-box-breaks/#findComment-198759 Share on other sites More sharing options...
genericnumber1 Posted March 3, 2007 Share Posted March 3, 2007 feel free to mark the topic solved. Link to comment https://forums.phpfreaks.com/topic/41043-text-box-breaks/#findComment-198761 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.