Hi. I am trying to make a list of links which will call a popup window to display data in two fields (warranty_comment, aw_tag). I have the links generating on the main page, which have the right id number at the end of the url, but when clicked, the popup comes up empty (unless I hard code the id number in to the window.php part of the script, which right now says "WHERE aw_id=9"). I need to somehow pass the aw_id variable from the main page to the window page, and have the window page use it to call up data from that row of the database. Ideas? Thanks much.
This is from the main admin page, which calls the next page (window.php)
$query="SELECT aw_id,warranty_comment FROM warranty";
$result=mysql_query($query);
while (list($aw_id,$warranty_comment)= mysql_fetch_row($result)){
print "<a href=\"javascript<img src="images/smilies/redface.gif" border="0" alt="">penWindow('window.php?action=viewwarranty2&view=$aw_id')\">$warranty_comment</a><br>";
}
--------------------------------------------
and this is code on the window.php page
}else if (($action == "viewwarranty2")) {
$query = "SELECT warranty_comment,aw_tag FROM warranty WHERE aw_id=9";
$result = mysql_query($query) or die("Query faiiled");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$fname = $row["warranty_comment"];
$trimmed = trim($fname);
$fname1 = $row["aw_tag"];
$trimmed = trim($fname1);
print "<table height='250'><tr><td valign='top' width='400'><font face='Arial' size='2'><p align='center'><b>$fname<br><br></b></p><br>$fname1</font></td></tr></table><font face='Verdana' size='1'>To edit this product's warranty, use the link titled \"Warranties\" on the admin page.</font>";
}