spires Posted November 8, 2007 Share Posted November 8, 2007 hi Guys. I'm submitting a form and trying to echo out the description. The description is typed into a text area field. When I echo the value, it does not include the line breaks. So, if I type: 'hello World' it echo out: 'hello world' How do I add the line breaks? <?php echo $msg = $_POST['message']; ?> <form name="form1" method="post" action="form_email.php"> <table bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" width="800" align="center"> <tr> <td width="111" align="right"> <br> <span class="organge_text">SUBJECT:</span><br> </td> <td width="540" height="25" align="left"><input type="text" name="title" size="25"/> <br> <br></td> <td width="147" align="left"></td> </tr> <tr> <td align="right"> <span class="organge_text">MESSAGE:</span> </td> <td align="left"> <textarea name="message" cols="60" rows="20" id="message"><?PHP echo $msg; ?></textarea></td> <td align="left"></td> </tr> <tr> <td height="25" align="right">Name<br></td> <td height="25"><input type="text" name="name" size="25"/></td> <td height="25"> </td> </tr> <tr> <td height="25" align="right">Email<br></td> <td height="25"><input type="text" name="email" size="25"/></td> <td height="25"> </td> </tr> <tr> <td class="ten_organge" align="center" colspan="3"> <input name="send" value="SEND EMAIL" type="submit"> <br><br> </td> </tr> </table> </form> Thanks for your help :-) Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 8, 2007 Share Posted November 8, 2007 breaks are in a textarea only, so use the nl2br function Quote Link to comment Share on other sites More sharing options...
spires Posted November 8, 2007 Author Share Posted November 8, 2007 Thats it :-) I have not done any PHP in months. Completely forgot about that. Cheers 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.