Web Hosting Talk







View Full Version : need php coding help


wseyller
04-18-2006, 09:45 AM
Get this error: Parse error: parse error, unexpected T_LNUMBER in /home/nrscoati/public_html/temp/index.php on line 3

Can't figure this out. I'm trying to learn. Some of it I was giving my best guess What is wrong with the code:


<?php

include("block-sellrollers.php");

$block_display = "<tr><td><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#eeeeee\" width=\"160\">/n";
.<tr><td><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"160\"><tr><td>/n";
.<img src=\"images/barside.gif\" height=\"12\" width=\"160\"></td></tr></table>/n";
.<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#000000\" width=\"100%\">/n";
.<tr><td bgcolor=\"#FFFFFF\" align=\"center\"><font size=\"2\" color=\"#363636\"><b>/n";
.echo $sellrollers_title/n;
.</b></font></td></tr><tr><td bgcolor=\"#eeeeee\">/n";
.echo $sellrollers_content/n;
.</td></tr></table></td></tr></table></td></tr><tr><td>/n";
.<img src=\"images/pixel.gif\" width=\"1\" height=\"10\" border=\"0\"></td></tr>"/n;
?>

the_pm
04-18-2006, 10:21 AM
Moved to programming discussions :)

Christopher Lee
04-18-2006, 10:26 AM
You terminated your concatination on the first line with ';'.

Try:

$block_display =<<<EOHTML
<tr><td><table border="0" cellpadding="0" cellspacing="0" bgcolor="#eeeeee" width="160">
<tr><td><table border="0" cellpadding="0" cellspacing="0" width="160">
<tr><td><img src="images/barside.gif" height="12" width="160"></td></tr></table>
<table border="0" cellpadding="3" cellspacing="1" bgcolor="#000000" width="100%">
<tr><td bgcolor="#FFFFFF" align="center"><font size="2" color="#363636"><b>
{$sellrollers_title}
</b></font></td></tr><tr><td bgcolor="#eeeeee">
{$sellrollers_content}
</td></tr></table></td></tr></table></td></tr><tr><td>
<img src="images/pixel.gif" width="1" height="10" border="0"></td></tr>
EOHTML;


or


$block_display = '
<tr><td><table border="0" cellpadding="0" cellspacing="0" bgcolor="#eeeeee" width="160">
<tr><td><table border="0" cellpadding="0" cellspacing="0" width="160">
<tr><td><img src="images/barside.gif" height="12" width="160"></td></tr></table>
<table border="0" cellpadding="3" cellspacing="1" bgcolor="#000000" width="100%">
<tr><td bgcolor="#FFFFFF" align="center"><font size="2" color="#363636"><b>' .
$sellrollers_title .
'</b></font></td></tr><tr><td bgcolor="#eeeeee">' .
$sellrollers_content .
'</td></tr></table></td></tr></table></td></tr><tr><td>
<img src="images/pixel.gif" width="1" height="10" border="0"></td></tr>';

Christopher Lee
04-18-2006, 10:28 AM
http://us3.php.net/manual/en/language.types.string.php

This will explain what you are seeing in more detail

RACKSET
04-18-2006, 04:11 PM
You should not use ( ; ) on php line ending when you use ( . ) for concat strings if multiple lines. Also you should change all /n to \n

This code should be:


<?php

include("block-sellrollers.php");

$block_display = "<tr><td><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#eeeeee\" width=\"160\">\n"
."<tr><td><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"160\"><tr><td>\n"
."<img src=\"images/barside.gif\" height=\"12\" width=\"160\"></td></tr></table>\n"
."<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#000000\" width=\"100%\">\n"
."<tr><td bgcolor=\"#FFFFFF\" align=\"center\"><font size=\"2\" color=\"#363636\"><b>\n"
.$sellrollers_title
."</b></font></td></tr><tr><td bgcolor=\"#eeeeee\">\n"
.$sellrollers_content
."</td></tr></table></td></tr></table></td></tr><tr><td>\n"
."<img src=\"images/pixel.gif\" width=\"1\" height=\"10\" border=\"0\"></td></tr>";
?>