tom_b Posted January 16, 2007 Share Posted January 16, 2007 Here's my problem code snippet, it's part of a message board. All I want is to have "Delete this message" appear on a new line after the "messagetext". Everything I've tried gives me some kind of error message.echo'<p><font color = "blue"><b>' . $messagetext . ' <a href="' . $_SERVER['PHP_SELF'] . ' ?deletemessage=' . $messageid . '">' . 'Delete this message</a></p>';Please help!!!!!!!!Thanks, Tom Link to comment https://forums.phpfreaks.com/topic/34352-php-output-line-break/ Share on other sites More sharing options...
pocobueno1388 Posted January 16, 2007 Share Posted January 16, 2007 [code]echo'<p><font color = "blue">' . $messagetext .echo "<a href='$_SERVER['PHP_SELF']?deletemessage=$messageid'>Delete this message</a></p>";[/code]Try that. Link to comment https://forums.phpfreaks.com/topic/34352-php-output-line-break/#findComment-161641 Share on other sites More sharing options...
pocobueno1388 Posted January 16, 2007 Share Posted January 16, 2007 Oops, forgot something.[code]echo "<p><font color = 'blue'> $messagetext ";echo "<a href='$_SERVER['PHP_SELF']?deletemessage=$messageid'>Delete this message</a></p>";[/code] Link to comment https://forums.phpfreaks.com/topic/34352-php-output-line-break/#findComment-161642 Share on other sites More sharing options...
tom_b Posted January 16, 2007 Author Share Posted January 16, 2007 No, the first one got me the old unexpected t_string error, the second try got the following:Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in Link to comment https://forums.phpfreaks.com/topic/34352-php-output-line-break/#findComment-161649 Share on other sites More sharing options...
pocobueno1388 Posted January 16, 2007 Share Posted January 16, 2007 This should work for sure:[code]echo"<p><font color ='blue'>$messagetext<br>";echo "<a href='{$_SERVER['PHP_SELF']}?deletemessage=$messageid'>Delete this message</a></p>";[/code] Link to comment https://forums.phpfreaks.com/topic/34352-php-output-line-break/#findComment-161660 Share on other sites More sharing options...
tom_b Posted January 16, 2007 Author Share Posted January 16, 2007 Perfect!!! Thanks so much, I couldn't figure it out!!! Is it the two separate echo statements that do it?Thanks again, Tom Link to comment https://forums.phpfreaks.com/topic/34352-php-output-line-break/#findComment-161664 Share on other sites More sharing options...
pocobueno1388 Posted January 16, 2007 Share Posted January 16, 2007 No, I just separated it into two different echo statements to make it easier to read. You had a lot of Concating going on, so I think there was a mistake somewhere in there. Link to comment https://forums.phpfreaks.com/topic/34352-php-output-line-break/#findComment-161666 Share on other sites More sharing options...
tom_b Posted January 16, 2007 Author Share Posted January 16, 2007 Oh, ok, that makes some sense. Still kind of new at this, kept trying to use the html <br> tag (after getting out of php!!!), wouldn't work. I really appreciate the help, thanks!!!!!!!!Tom Link to comment https://forums.phpfreaks.com/topic/34352-php-output-line-break/#findComment-161669 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.