I have a problem with my script i am trying to format a text area so that on the next page it displays it as it was entered in the textarea.

my css style says this

textarea {
font: normal 1em Verdana, sans-serif;
border:1px solid #eee;

then it is a simple htmll textarea on a php page.

<td class="mytransr" id="t_mess">
Message To Client</td>
<td class="mytransr">
<textarea name="message"></textarea>

<br /></td>


the next pae starts and has the line

$message        =   stripslashes($_POST["message"]);

and down the page i have <td><?=$message?>

the problem is in the text area i put

hello how are you?
where are you?
are you there?

on the second page where it displays message it comes out as

hello how are you? where are you? are you there?

how can i make this come out in the same format as it was entered in the initial textarea???

I have been at this 4 hour and hours can anyone ive me a hint please.


Try this:

$message = stripslashes(nl2br($_POST["message"]));

nl2br is a PHP function to replace new lines with <BR> tags

Sorry again I don't supppose there is a way to make urls display as hyperlinks that are sent in a textarea?

i.e www.google.com so it comes out as a hyperlink?

search "BBCode php" and you should have some luck, don't try to re-invent the wheel :p

you can use a free WYSIWYG editor. try tinymce ...