Re: newlines in <textarea> boxes..

From: Date: Thu, 01 Feb 2001 06:40:22 +0000
Subject: Re: newlines in <textarea> boxes..
References: 1  Groups: php.db php.general 
Request: Send a blank email to php-db+get-6292@lists.php.net to get a copy of this message
He! It's very simple! When you've a <textarea name="text"></textarea>, and want per example to insert it into the database, use the PHP function nl2br() at the moment after select and print the data. So, it will be: - first insert the $text into the database - SELECT text FROM XXX et. etc. - $text = nl2br($text); (PHP inserts <br>'s into $text) - print($text); You can also directly use the function nl2br and print the string after submitting the form! Ready! Simple, isn't??? Bey bey, Daniel Kieviet Xsarus Internetservices The Netherlands http://www.xsarus.nl info@xsarus.nl ----- Original Message ----- From: "James Smith" <ff8_az@yahoo.com> To: <php-general@lists.php.net>; <php-db@lists.php.net> Sent: Wednesday, January 31, 2001 1:18 PM Subject: [PHP-DB] newlines in <textarea> boxes.. > Alright, on my site, I have a news section, whenever i > goto insert new news in the Admin area, I have to > insert <br> or /n in it, while typing in the news. > How do I make this a automated process I know it can > be done, but addslashes doesn't work and > htmlspecailchars() doesn't work what will? > > Thanks, > > James > > __________________________________________________ > Get personalized email addresses from Yahoo! Mail - only $35 > a year! http://personal.mail.yahoo.com/ > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#6292) next »