I am lost as to why this thing is not working. I am creating a database for a band to list their shows and pictures from each show. I have a page called shows.php which dynamically lists all of the shows in the database and assigns a variable called $showID to be passed along to the next page. This thumbs.php page will pull the thumbnail images according to the $showID. From there if you click on a thumbnail it will call the page imageDisplay.php which will display the correct image from that show according to its $showID and $picID.
All of this works fine until I include the thumbs.php and imageDisplay.php into a frameset page called pics.php. It is basically setup kind of like your images folder in Windows when you view it in Thumbnail View.
Anyway can anyone tell me why this doesn't work when I use the frame?
Below is some of the code:
shows.php
<?
$sql = "SELECT showID, date
FROM shows ORDER BY showID ASC";
$res = mysql_query($sql);
while($show = mysql_fetch_array($res)) {
echo"
<tr>
<td>
<a href='http://66.195.17.117/~movingto/pics.php?showID=".$show['showID']."'>".$show['date']."</a>
</td></tr>";
}
?>
pics.php //this is the frame page
<?
session_start();
$showID = $_GET['showID'];
$_SESSION['showID'] = $showID;
?>
thumbs.php
session_start();
$showID = $_GET['showID'];
$_SESSION['showID'] = $showID;
$sql = "SELECT *
FROM images WHERE showID = ".$showID."";
$res = mysql_query($sql);
while($image = mysql_fetch_array($res)) {
echo ("
<td width='75' height='50'><a href='http://66.195.17.117/~movingto/imageDisplay.php?id=".$image['id']."' target='display'><img src='http://66.195.17.117/~movingto/pics/".$image['location']."/".$image['thumb'].".".$image['ext']."' width='75' height='50' border='0'></a></td><td width='25'></td>
");
}
imageDisplay.php
session_start();
$_SESSION['showID'];
$id= $_GET['id'];
if(!isset($id)){
$sql = "SELECT id
FROM images WHERE showID = ".$_SESSION['showID']." ORDER BY ASC";
$res = mysql_fetch_array(mysql_query($sql));
$id = $res[0];
$sql2 = "SELECT location, pic, ext
FROM images WHERE showID = ".$_SESSION['showID']." AND id = ".$id."";
$res = mysql_fetch_array(mysql_query($sql2));
}else{
$sql = "SELECT id, location, pic, ext
FROM images WHERE showID = ".$_SESSION['showID']." AND id = ".$id."";
$res = mysql_fetch_array(mysql_query($sql));
}
<img src='http://66.195.17.117/~movingto/pics/".$res['location']."/".$res['pic'].".".$res['ext']."'>
Thanks for your help in advance.