Ok, this is a long one. I dont really know how to explain this but here it goes. I have on a page for a customer 2 randomly generated images. Each in thier own tables on seperate side of the pages. Here is what it is supposed to do:
When a user comes to site, it randomly queries a "stones table" and displays info and a clickable image. This clickable image then passes the image name to another page to view it in greater detail. This is also the same for the other image which is comming from an "herbs" table.
Now the problem:
When you click on the "stones" image it works just fine, but when you click the "herbs" image, it brings up the same as the stone did. I even have each image displaying the info to a different page and it is still not working. You can see what I am talking about if you go to the website and try clicking on the stone, and then click on the herb. The website is here
I am not sure of what all code to include so here is the index with all the includes for the images:
Index code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Welcome to Middlemagick.com! ~ A little magick in the middle never hurt!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="styles/stylesheet.css" rel="stylesheet" type="text/css">
</head>
<body background="images/backgrounds/lavender_marble.gif" bgproperties="fixed">
<center>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="20" height="100"> </td>
<td colspan="6" valign="top"><? include "header.html"?></td>
</tr>
<tr>
<td height="125"> </td>
<td width="87" valign="top"><?php include"randomstone.php";?> </td>
<td width="15"> </td>
<td width="552" rowspan="3" valign="top" background="styles/bg_grad.jpg" class="Body_Text"><blockquote>
<p align="center" class="Title">Merry Meet! 1 <br>
</p>
<hr>
<p align="center" class="Title"> </p>
<p align="justify" class="mainBody">Welcome to the home of MiddleMagick. Some of you might be wondering why we chose the name MiddleMagick And also why we chose to spell it that way....well wonder no more we figured that we would delve in to both of the worlds of Magick. The reason that we chose to spell the word "Magick" the way that we did is that we are not interested in tricks, we want to share with you Elemental Magick. Magick that only comes from the universe.</p>
<p align="justify" class="mainBody">Some of you might have some questions about Magick so be sure to visit our FAQ page it should answer any question that you might have about our purpose. If you are anything like me, you would like to know the history of Wicca, I hope that I can only add to your knowledge. If there is something that you would like to share with us. Please feel free to let us know. </p>
</blockquote>
<div align="center">
</div></td>
<td width="15"> </td>
<td colspan="2" valign="top"><?php include 'randomherb.php';?> </td>
</tr>
<tr>
<td height="152"> </td>
<td rowspan="2" valign="top"><IFRAME align="center" SRC="http://www.pagannews.com/r.htm?" frameborder=0 framespacing=0 height=340 width=230 scrolling=no ></IFRAME></td>
<td> </td>
<td> </td>
<td colspan="2" valign="top"><a href="mailto:marx_jt@hotmail.com?subject=Advertisement%20Request">Advertise With Us!</a>
</td>
</tr>
<tr>
<td height="61"> </td>
<td> </td>
<td> </td>
<td width="39"> </td>
<td width="36"> </td>
</tr>
<tr>
<td height="34"> </td>
<td colspan="5" valign="top"><?php include "footer.html"?></td>
<td> </td>
</tr>
</table>
</center>
</body>
</html>
Here is the randomstone.php include:
<?php
mysql_select_db($database_mysqlconn, $mysqlconn);
$query_randStone = "SELECT * FROM stones ORDER BY RAND() LIMIT 0,1";
$randStone = mysql_query($query_randStone, $mysqlconn) or die(mysql_error());
$row_randStone = mysql_fetch_assoc($randStone);
$totalRows_randStone = mysql_num_rows($randStone);
?>
<table width="269" border="1" cellpadding="1" cellspacing="1" bordercolor="#000000">
<!--DWLayoutTable-->
<tr>
<td height="20" colspan="2" align="center" valign="middle" class="Title">
Featured Stone
</td>
</tr>
<tr>
<td width="112" height="24" valign="middle"><div align="left"><strong><span class="mainBodyBOLD">Herb Name: </span></strong></div></td>
<td width="151" valign="middle" class="mainBody"><div align="justify"><?php echo $row_randStone['stone']; ?></div></td>
</tr>
<tr>
<td height="1"></td>
<td></td>
</tr>
<tr>
<td height="22" valign="middle"><div align="left"><strong class="mainBodyBOLD">Common Uses: </strong></div></td>
<td valign="middle"><div align="justify" class="mainBody"><?php echo $row_randStone['uses']; ?></div></td>
</tr>
<tr>
<td height="123" colspan="2" valign="middle"><div align="center"><img src="images/stonethumb/<?php echo $row_randStone['pic']; ?>" width="87" height="119" border="0" usemap="#Map"></div></td>
</tr>
</table>
<map name="Map">
<?php echo "<area shape=\"rect\" coords=\"1,1,88,119\" href=\"fullstone.php?pic=".$row_randStone['pic']."\" target=\"_blank\">"?>
</map>
</body>
</html>
<?php
mysql_free_result($randStone);
?>
And last but not least, here is the randomherb.php include:
<?php
mysql_select_db($database_mysqlconn, $mysqlconn);
$query_randomHerb = "SELECT * FROM herbs ORDER BY RAND() LIMIT 0,1";
$randomHerb = mysql_query($query_randomHerb, $mysqlconn) or die(mysql_error());
$row_randomHerb = mysql_fetch_assoc($randomHerb);
$totalRows_randomHerb = mysql_num_rows($randomHerb);
?>
<table width="269" border="1" cellpadding="1" cellspacing="1" bordercolor="#000000">
<!--DWLayoutTable-->
<tr>
<td height="20" colspan="2" valign="middle" align="center>
<div align="center" class="Title">Featured Herb
</div> </div></td>
</tr>
<tr>
<td width="112" height="24" valign="middle"><strong><span class="mainBodyBOLD">Herb Name: </span></strong></td>
<td width="151" valign="middle" class="mainBody"><?php echo $row_randomHerb['herb']; ?></td>
</tr>
<tr>
<td height="1"></td>
<td></td>
</tr>
<tr>
<td height="22" valign="middle"><strong class="mainBodyBOLD">Common Uses: </strong></td>
<td valign="middle"><div align="justify" class="mainBody">
<div align="left"><?php echo $row_randomHerb['usage']; ?></div>
</div></td>
</tr>
<tr>
<td height="123" colspan="2" valign="middle"><div align="center"><img src="images/herbthumb/<?php echo $row_randomHerb['thumb']; ?>" width="87" height="119" border="0" usemap="#Map"></div></td>
</tr>
</table>
<map name="Map">
<?php echo "<area shape=\"rect\" coords=\"1,1,88,119\" href=\"fullimage.php?imagename=".$row_randomHerb['fullpic']."\" target=\"_blank\">"?>
</map>
</body>
</html>
<?php
mysql_free_result($randomHerb);
?>
I know my explanation is not all that great so that is why you would really have to see this first hand. Again the website can be seen here
If there is anything else that I need to post or any other info that would help, please let me know.
Btw, I know the code is sloppy so please bear with me on that one. Once I get things running correctly then I go back and clean it up and stuff.
Thanks,
Todd😃