Page 1 of 1

new line ,<br> spaces and line breaks.

Posted: Mon Dec 19, 2005 1:16 pm
by Traveller
Script URL:
Version of script: 1.34
Version of PHP: 4.5
Hosting company: fastnet
Have you searched THIS FORUM for your problem: yes
(if not please do before posting)
If so, what terms did you try: misaligning, line breaks

Write your message below:

Hello people, has anybody had the problems of the line breaks within submitted messages ?

In IE it creates <br> spaces and shows the message as it was typed, in Firefox it tends to miss out the <br>/line breaks and doesnt look like how it was typed,it sort of confuses a space for a <br> or something.

I have done a few of the things suggested in various posts,

i have $settings['system'] == 1, unix server

i.e, $comments = wordwrap($comments,$settings['max_word'],' ',1);


but that only sorted out the maxword and not the general <br> within the submitted comments.

any real time suggestions or symantecs about this ?

Cheers

Posted: Mon Dec 19, 2005 2:06 pm
by Traveller
Hello,

I figured it out,

for some reason i had this code

$comments = wordwrap($comments,$settings['max_word'],' ',1);
$comments = str_replace("\r\n","<BR>",$comments);
$comments = str_replace("\n","<BR>",$comments);
$comments = str_replace("\r","<BR>",$comments);


when it should have been this code

$comments = str_replace("\r\n","<BR>",$comments);
$comments = str_replace("\n","<BR>",$comments);
$comments = str_replace("\r","<BR>",$comments);
$comments = wordwrap($comments,$settings['max_word'],' ',1);

just putting the

$comments = wordwrap($comments,$settings['max_word'],' ',1);

underneath the other str_replace instead of above corrected it