| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Apr 2004 Location: IL
Posts: 348
![]() | 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. |
| |
| | #3 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,552
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | \r\n
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| |
| | #4 (permalink) |
| NamePros Member Join Date: Nov 2005
Posts: 126
![]() | If you're talking how to show 'Enters' submitted by a form into pure HTML, use the php function nl2br: ????: NamePros.com http://www.namepros.com/programming/150269-php-help.html PHP Code:
__________________ Useful? Add to my reputation! Your link in MY sig! AMAZING PRICES! | My BB solution Your Link Here | FREE Sig Space!!!!!! |
| |
| | #5 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | presumably you are having problems of the text only showing on 1 line when you rtetrieve it back from the database. If that is the case run the variable through nl2br(). This changes the new line char to the <br> which html needs. |
| |
| | #6 (permalink) |
| Eating Pie Join Date: Nov 2004 Location: Canada
Posts: 2,272
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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. |
| |
![]() |
| 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 12:35 PM |
| Great Scripts for Sale With Resale Rights! | Zeeble | Scripts For Sale | 20 | 01-04-2006 02:39 AM |
| Googlism - What does google think of you? | deadserious | The Break Room | 55 | 12-15-2005 10:09 AM |