Hello, I have a strange error when I eval a chunk of html and php. The weird thing is this was on a server with cgi php 4.03 and when I moved it to a new server with mod_php v 4.04 i get the following error.
Parse error: parse error, expecting T_STRING' orT_VARIABLE' or `T_NUM_STRING' in /usr/local/etc/httpd/vhosts/aguideto/anaheim/page_index.php(31) : eval()'d code on line 148
This first bit of code is where I eval the template string.
while ($p_row = mysql_fetch_array($p_result))
{
$spc_table = $p_row["spc_table"];
$hps1_table = $p_row["hps1_table"];
$hps2_table = $p_row["hps2_table"];
$hps3_table = $p_row["hps3_table"];
$hps4_table = $p_row["hps4_table"];
$t_id = $p_row["template"];
$t_sql="SELECT * FROM template WHERE t_id='$t_id'";
$t_result = mysql_query($t_sql);
while ($t_row = mysql_fetch_array($t_result))
{
$t_name = $t_row["t_name"];
$t_contents = $t_row["t_contents"];
//print "set: $sectA";
eval ("?>$t_contents");
}//end of template while
}//end of page while
This is the a chunk of the evaled code where the error occors line 148 is where the first if statment is
"if ($cat_row["nbc_name"] != "Top Navigation")"
<!---start link gen--->
<?php
$cat_sql = "SELECT FROM nav_catagory";
$cat_result = mysql_query($cat_sql);
while ($cat_row = mysql_fetch_array($cat_result))
{
if ($cat_row["nbc_name"] != "Top Navigation")
{
$nbc_id = $cat_row["nbc_id"];
$nbc_img = $cat_row["nbc_img"];
$nbc_img_alt_tag = $cat_row["nbc_img_alt_tag"];
?>
<!---Print catagory img--->
<tr>
<td><img src="images/<?php print "$nbc_img"; ?>" alt="<?php print "$nbc_img_alt_tag"; ?>"></td>
</tr>
<tr>
<td width="125" valign="top">
<!--start links table--->
<table width="120" cellpadding="2" cellspacing="0" borders="0" align="center">
<tr>
<td id="color1" valign="top" class="sidemenulinks">
<?php
$nb_sql = "SELECT FROM navbar WHERE nb_catagory='$nbc_id'";
$nb_result = @($nb_sql);
while ($nb_row = mysql_fetch_array($nb_result))
{
$nb_name = $nb_row["nb_name"];
$nb_use_alt = $nb_row["nb_use_alt"];
$nb_url = $nb_row["nb_url"];
$nb_alt_url = $nb_row["nb_alt_url"];
if ($nb_use_alt == 'y'){?><a href="<?php print "$nb_alt_url"; ?>"><?php print "$nb_name"; ?></a><br><?php }
else{?><a href="<?php print "page_index.php?p_id=$nb_url"; ?>"><?php print "$nb_name"; ?></a><br><?php }
}//end nb while
print "<br></td></tr></table></td></tr>";
}//end not top if
}//end cat while
?>
<!---end link gen--->
Thanks in advance for any help.. I've been very stressed error.
thoMas