Hi all,
I have a html form where the user enters content into a textarea.
That content is then submitted into a MS SQL Server Database.
How do I ensure that correct formatting e.g. <p> tags are also inserted??
Thanks.
if you mean to allow new lines, so they are preserved.
then you may want to use the function :
nl2br()
I'd use this when outputting the data.
Try something like this:
function encode($text) // Will add slashes and HTML linebreaks to variables submitted by user { if (!get_magic_quotes_gpc()) { $uittext = addslashes($text); } else { $uittext = $text; } return $uittext; }