Forum Moderators: coopster
<?php
session_start();
$dbconn = mysql_connect("", "", ""); //DataBase connection settings
if (!$dbconn) { //Connection Settings Verification
echo( "<P>Unable to connect to the database server at this time.</P>" );
exit();
}
mysql_select_db("independentofficegroup", $dbconn); //Connecting to the database
if (! @mysql_select_db("independentofficegroup") ) { //Connection Verification
echo("<P>Unable to locate the database at this time.</P>");
exit();
}
$sqlresult = mysql_query("SELECT * FROM tblProducts"); //finding all the products
if (!$sqlresult) {
echo("<P>Error performing query for all Products, please contact administrator</P>");
exit();
}
?>
<html>
<title>Teporary Products Page</title>
<body link="#000000" vlink="#000000" alink="#000000">
<table width="800" height="600"border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<!--Start of top region-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="18%" height="78" align="left"><img src="/images/ilogo.gif"></td>
<td width="53%" align="center"><img src="/images/indylogo.gif"></td>
<td width="29%"> </td>
</tr>
</table>
<!--End of top region-->
<!--Start of bottom region-->
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="500">
<tr>
<td width="150" height="500" align="left" valign="top"> <font size="2">
<?PHP
//This is the include for the left margin
include 'leftmargin.php';
?>
</font></td>
<!--Start of center-->
<td width="650" height="500" valign="top"> <table cellpadding="2" cellspacing="2">
<tr>
<td><center>
<strong>Picture</strong></center></td>
<td><center>
<strong>Name</strong></center></td>
<td><center>
<strong>Description</strong></center></td>
<td><center>
<strong>Features</strong></center></td>
</tr>
<?php
//Start Products Loop
while ($row = mysql_fetch_array($sqlresult)) {
$ProdIDTemp = $row["ProdID"]; //Temp ID for next SELECT query
echo("<tr>");
//**********START THE PROBLEM LINE*****************
echo("<td valign='top'><a href='test.php' onClick='" $_SESSION['ProdIDTemp'] = $ProdIDTemp "'><img border='0' src='/images/small/". $row["ProdImageSmall"]. "'></a></td>");
//**********END THE PROBLEM LINE*****************
echo("<td valign='top'>". $row["ProdName"]. "</td>");
echo("<td valign='top' width='350'>". $row["ProdDesc"]. "</td>");
$sqlresultProdFeat = mysql_query("SELECT ProdFeat1, ProdFeat2, ProdFeat3, ProdFeat4,
ProdFeat5, ProdFeat6, ProdFeat7, ProdFeat8
FROM tblProducts WHERE ProdID = ". $ProdIDTemp ." "); //
if (!$sqlresultProdFeat) {
echo("<P>Error performing query Product Feature Query, please contact administrator</P>");
exit();
}
while ($rowFeat = mysql_fetch_array($sqlresultProdFeat)) {
echo("<td valign='top' width='350'> <ul>");
$a = 9; //Max amount of feature (1-8)
for ($i = 1; $i < $a; $i++) {
if ($rowFeat["ProdFeat".$i]!= "") {
echo("<li>".$rowFeat["ProdFeat".$i]."</li>");
}
else{
}
}
echo("</ul></td>");
}
echo("</tr>");
echo("</form>");
}
?>
</table>
<p> </p>
</td>
</tr>
</table>
<!--End of center-->
</td>
</tr>
</table>
</body>
</html>
$_SESSION['ProdIDTemp'] = $ProdIDTemp
with
$_SESSION['ProdIDTemp'] = time()
and I'm able to pull the data through onto the sencond page. Would there be a better way to do this?