hello, i'm trying to create a comment, so everything works fine but i have a prob:
When i enter the comment in the comment box and write:
"
test test 123
test
test
"
in the page wich shows the comment this will appear "test test 123 test test" with to "return new line"
but actually i pressed "enter" 2 times
so ishould write the comment like this:
"
<p>test test 123</p>
<p>test</p>
<p>test</>
"
thank for your helps ..
comment box
Moderator: General Moderators
Re: comment box
Type the comment the normal way, then print out the comment with:
I recommend you to read the docs for these functions and something about security and input escaping:
http://php.net/manual/en/function.nl2br.php
http://php.net/manual/en/function.htmlentities.php
http://www.mt-soft.com.ar/2007/12/21/th ... -mistakes/
Code: Select all
echo nl2br(htmlentities($comment));http://php.net/manual/en/function.nl2br.php
http://php.net/manual/en/function.htmlentities.php
http://www.mt-soft.com.ar/2007/12/21/th ... -mistakes/