| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Regular | PHP help. How do I insert line breaks into a text area form input when a users hits the enter to start a new line. The form is submited via PHP to be stored in a database. Everything works fine just needing to know how to insert the line breaks.
__________________ Four Seasons Outfitters [ 25 $NP/Month ] [ 25 $NP/Month ] [ 25 $NP/Month ] [ 25 $NP/Month] [ 25 $NP/Month] |
| |
| | #4 (permalink) |
| NamePros Member | If you're talking how to show 'Enters' submitted by a form into pure HTML, use the php function nl2br: PHP Code:
__________________ Useful? Add to my reputation! Your link in MY sig! AMAZING PRICES! | My BB solution Your Link Here | FREE Sig Space!!!!!! |
| |
| | #6 (permalink) |
| Eating Pie | It depends what you want to do with the results from the textarea. If you wish to display it as text either nl2br or wordwrap will work. If you wish to store it in mysql db I would probley use nl2br. If you don't need to do anything but store it to be used in another textarea nothing is needed. iNod.
__________________ I feel old. |
| |
| | #7 (permalink) |
| NamePros Regular | Thanks everyone I used nl2br() and it works just how I wanted. I store the information in the database then it is displayed on a page at a later time. I gave everyone 10 np's for helping.
__________________ Four Seasons Outfitters [ 25 $NP/Month ] [ 25 $NP/Month ] [ 25 $NP/Month ] [ 25 $NP/Month] [ 25 $NP/Month] |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tutorial: Getting started with PHP (The Basics) | deadserious | Webmaster Tutorials | 60 | 11-17-2007 11:35 AM |
| Great Scripts for Sale With Resale Rights! | Zeeble | Scripts For Sale | 20 | 01-04-2006 01:39 AM |
| Googlism - What does google think of you? | deadserious | The Break Room | 55 | 12-15-2005 09:09 AM |