Can somebody please help me with this problem.
I'm simply trying to display a message from users. The message comes to my database from a textarea. My problem is when I am typing message and formatting it with breaking into paragraphs it is not display in that format and display it as a one long paragraph.
like this.
To change the overall look of your document, choose new Theme elements on the Page Layout tab. To change the looks available in the Quick Style gallery, use the Change Current Quick Style Set command. \r\n\r\nBoth the Themes gallery and the Quick Styles gallery provide reset commands so that you can always restore the look of your document to the original contained in your current template.
I tried with nl2br() and strip_tags() but still no luck
The Code from validation message.
// Check for message
if ( !empty ( $_POST['message'])) {
if ( mb_strlen ( $_POST['message'], 'UTF-8') <= 20 ) {
$reg_errors['message'] = 'Your message must be greater than 20 characters';
} else {
$message = mysqli_real_escape_string($dbc, $_POST['message']);
}
} else {
$reg_errors['message'] = 'Message: This field is required.';
}
This is the code I use when select message from db
$message= $row['message'];
$message= nl2br(strip_tags($message));
when echoing $message it print a paragraph like above.
tag with my code. – TNK Feb 09 '13 at 14:15