JustinMs66@hotmail.com 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; } ?> Quote Link to comment 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; } ?> Quote Link to comment Share on other sites More sharing options...
JustinMs66@hotmail.com Posted March 3, 2007 Author Share Posted March 3, 2007 Awesome THANKS!!! Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted March 3, 2007 Share Posted March 3, 2007 feel free to mark the topic solved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.