Im building a website using just the index.php and includes for the different pages. When someone clicks the link, it will send itself index.php?content=gallery.php so it changes the content. My problem comes when the gallery comes into play. Here is the code:
<?php
if(isset($picture) && $content=='gallery.php'){
echo "<img src='gallery/".$pic."'/>";
}else{
echo "Please select a picture to view on the far right";
}
?></div>
<div id="galleryNavTable" class="bodytype">
<table align="center" width="80%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<th scope="col"><span class="style1">Select an Image</span></th>
</tr>
<?php
//The source Directory of the images
$d = dir("gallery/");
while($pic=$d->read()) {
//the numbering beside the row of links
$i=$i+1;
if(($pic <> '.') AND ($pic <> '..')){
?>
<tr>
This is where my trouble comes. How do I send the variable to the proper part in the a href tag?
<td align="center"><a href="index.php?content=gallery&picture=<?php print "$pic";?> " target="_self"><?php echo $i?> </a></td>
</tr>
<tr><td> </td>
</tr>
<?php
}
}
$d->close();
?>
Any help on this would be greatly appreciated!