For a website I recently made, I created a file called "image.php" and used a parameter ("url") to locate the image.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Image: <?php print $_GET['url']; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {
background-image: url('images/img-bk-cross.gif');
margin: 0px;
}
</style>
</head>
<body>
<img src="<?php print $_GET['url']; ?>" alt="" />
</body>
</html>
I used this for an "enlarge image" type of thing, and because the company had all their product images the same size, I used javascript to size the window. Looked much better than having a lot of whitespace in the window.
If you wanted, you could make it more adavanced by adding captions and titles. To do this, you could either assign an id to the image, then use a parameter like: "id=34" to identify the url, and caption; titles anythign else you'd want. OR, you could use the image path from the root (eg. images/catalog/34.jpg).
- Obviouslly the captions and titles would be stored in a database.
If you are interested in storing the ACTUAL image in the database, it would have to be some kind of binary or encryption used.