I am writing a form using php the form has a textarea and the data is sent to the script using $_POST
; then stored into db.
The problem is that when the textbox is populated and if the user do not press enter to make a new line break but he wait until the end of the width of the textarea the text stored in the db is all in one line, for example if he wrotes:
HELLO THIS IS TEXT AND IT COVERS ALL THE WIDTH OF THE TE<=end of textbox (no br no /n) XTAREA.
This even if when you reach the maximum width of the textbox the text goes in a new line. when I print the message with a query the result is all in one line (which screw up my site layout)
I have managed to record user ENTER strokes by using this code:
$cleaned_message=str_replace(Chr(13),'<br>', $cleaned_message);
But i cannot figure out what to do if he doesn't use ENTER KEY.