Hi everyone,
I have a simple php/mysql program that creates a table for a inventory list, e.g. part num, description, price,etc. It works fine in IE but FF and Safari just dump code onto the page, exactly the same way, …but not all the code. I’ve stripped out everything nonessential but can’t see the problem; here is
the coding listing followed by the dump listing:
<?php
session_start();
$page_title=”Product Table”;
require_once(‘mysql_db_connection.php’);
echo ‘<link href=”main.css” rel=”stylesheet” type=”text/css” />’;
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “
<html xmlns=”
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<link href=”CascadeMenu.css” rel=”stylesheet” />
<title>Untitled Document</title>
</head>
<body>
<div id=”main_wraper”>
<?php
$display=4;
if(isset($_GET[‘page’]))//check if page reloads indicating more than one page required;if not only one page required
{
$cur_page=$
}
else
{
$cur_page=1;
}
if(isset($_GET[‘np’]))
{
$numpages=$
}
else {
//perform the query to see total number of records rquired
$query=”SELECT COUNT(*) FROM items”;
$result=mysql_query($query) or die(mysql_error());
$row=mysql_fetch_array($result);
$rec_total=$row[0];
if($rec_total>$display){
$numpages=ceil($rec_total/$display);
}
else
{
$numpages=1;
}
}//end if get[np] isset
//check if the page reloads with a set query limit; if not query limit is set to start at zero
if(isset($_GET[‘start’]))
{
$start=$
}
else
{
$start=0;
}
$query2=”SELECT
$result2=mysql_query($query2) or die(mysql_error());
if(!$result2)
echo ‘<h3>THERE IS A PROBLEM WITH TABLE REULTS</h3>’;
//start output the table of product items
echo ‘<div id=”table”>
<h3>PRODUCT LISTING TABLE FOR PAGE: ’.$cur_page.'</h3>’;
echo ‘<table cellspacing=”0″ cellpadding=”5″ border=”2″ width=”600″ align=”left” bgcolor=”#FFCC99″>
<tr><th>ITEM</th><th>MODEL</th><th>DESCRIPTION</th><th>UNIT PRICE</th><th>ENTER QUANTITY</th><th> BUY </th></tr>’;
echo ‘<p>Product Pages: ’;
for($i=1;$i<=$numpages;$i++)
{
$start=$display*($i-1);
echo ‘<a href=”products.php?start=’.$start.’&np=’.$numpages.’&page=’.$i.'”>’.$i.’ </a>’;
}
while($row=mysql_fetch_array($result2))
{
$part_num=$row[‘cat_num’];
echo ‘<form action=”curr_cart.php” method=”post”>
<input type=”hidden” name=”part_num” value=” ‘.$part_num.’ “>
<input type=”hidden” name=”action” value=”1″ >’;
echo ‘<tr><td><img src=”prod_images/’.$row[‘sm_pic’].'”</td><td>’.$row[‘sh_des’].'</td><td>’.$row[‘lg_des’].'</td><td>’.$row[‘unit_price’].'</td><td><input name=”quan” size=”5″ value=”1″></td>
<td><input type=”submit” value=”BUY” ></form></td></tr>’;
}
mysql_close();
?>
</div>
</body>
</html>
And here is what is being dumped onto the page!! (I did not include all of the dump, just first section)
‘; ?>
$display){ $numpages=ceil($rec_total/$display); } else { $numpages=1; } }//end if get[np] isset //check if the page reloads with a set query limit; if not query limit is set to start at zero if(isset($_GET[‘start’])) { $start=$
Any suggestions would be very appreciated
captsig