fresh my man I'm glad to see you're getting into this PHP thing so much.
Check it out though, I'm going to show you a different way to handle this kinda of thing.
Basically, this script is just taking an image name identifier and showing the correct image for it, no? Why not take this dynamic thing all the way and save ourselves a few more lines?
Code:
<?php
if($_GET['img'])
{
$image_dir = "/var/www/public_html/images/"; // Absolute URL
$image_rel = "images/"; // Relative URL
$file = addslashes($_GET['img']); // Clean up filename
if(file_exists($image_dir.$file))
{
echo "<img src=\"".$image_rel.$file."\" />";
}
else
{
echo "Error reading imagefile";
}
}
echo "<a href=\"index.php\">Go Back</a>";
?>
Just off the top of my head, but now you can specify ANY imagename and it will automatically check for it before displaying it. No more control structures for each and every name!
That is if this is what you were trying to accomplish of course.