RE: [PHP-DB] TEXTAREA ...

From: Date: Fri, 19 Jul 2002 01:06:00 +0000
Subject: RE: [PHP-DB] TEXTAREA ...
Groups: php.db 
Request: Send a blank email to php-db+get-20645@lists.php.net to get a copy of this message
do i understand the question correctly? you are getting a "<br />" when you are expecting a "<br>" ? if that's the case then the simple answer (and as Jason pointed out, this is in the manual) is that it's the same thing, but with the " /" in it, it becomes XHTML compliant. As copied directly from the manual; --- Note: Starting with PHP 4.0.5, nl2br() is now XHTML compliant. All versions before 4.0.5 will return string with '<br>' inserted before newlines instead of '<br />'. --- enjoy and please don't under-estimate the quality of the manual (www.php.net/manual/en/) because it, combined with some sample code from around the place (and a bunch of spare time!) is really all you need to get going :) Beau // -----Original Message----- // From: José Moreira [mailto:jmoreira@e-terno.net] // Sent: Thursday, 18 July 2002 11:19 PM // To: 'Martin Clifford'; Php-Db (Correio electrónico) // Subject: RE: [PHP-DB] TEXTAREA ... // // // good day/afternoon/night // // why do i get this : // // $content = htmlentities($content);<br /> // // when i insert this : // // $content = htmlentities($content);[new line] // // using this : // // $thePost = // nl2br(addslashes(htmlspecialchars($HTTP_POST_VARS["POST"]))); // // when i want this : // // $content = htmlentities($content);<br> // // and i sometimes get // // <br /><br /> // // // once again sorry for asking non-db questions // // good work // // // -----Mensagem original----- // De: Martin Clifford [mailto:MLC1@nrc.gov] // Enviada: quarta-feira, 17 de Julho de 2002 15:02 // Para: martin.adler@continum.net; php-db@lists.php.net // Assunto: Re: [PHP-DB] TEXTAREA ... // // // Yup. So: // // $content = nl2br(htmlentities(stripslashes($content))); // // Good for echo'ing HTML into the page // // $content = nl2br($content); // // Good for showing $content with HTML formatting // // Martin Clifford // Homepage: http://www.completesource.net // Developer's Forums: http://www.completesource.net/forums/ // // // >>> "Martin Adler" <martin.adler@continum.net> 07/17/02 09:48AM >>> // That's right but if the variable is initialised by the form // and you want to // write the variable in to your html-document it's better to write this // // $content = nl2br(htmlentities(stripslashes($content))); // // ----- Original Message ----- // From: "Martin Clifford" <MLC1@nrc.gov> // To: <jmoreira@e-terno.net>; <php-db@lists.php.net> // Sent: Wednesday, July 17, 2002 3:15 PM // Subject: Re: [PHP-DB] TEXTAREA ... // // // $content = nl2br($content); // // That will convert all newline characters into <br> tags. // // HTH // // Martin Clifford // Homepage: http://www.completesource.net // Developer's Forums: http://www.completesource.net/forums/ // // // >>> José Moreira <jmoreira@e-terno.net> 07/17/02 09:15AM >>> // hello ... im sorry to bother with a non-db question but i // searched for this // and got 0 record :P // // its all about the wrappig in textareas: // // how can i convert the end of line/ line breaks ['enter' // keys] that the user // hits while // filling a textarea so that when i display the record content // the text does // break where the user intended ??? // // ex.: // // <textarea>bla blah blah // bla blah blah</textarea> // // if i echo() this textarea value i will apear in a single // line even if the // user pressed enter 2 break the line // // // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, visit: http://www.php.net/unsub.php // // // // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, visit: http://www.php.net/unsub.php // // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, visit: http://www.php.net/unsub.php // // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, visit: http://www.php.net/unsub.php //

« previous php.db (#20645) next »