Viewing file: image_viewer.php3 (2.24 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<HTML>
<BODY>
<?
/*
Simple Image Viewer PHP 1.01
Copyright 2000 KMR Enterprises
Scripted by TDavid @ http://www.tdscripts.com/
Created: 2/1/2000
Last Modified: 7/31/2000
By using this script you agree to indemnify KMR Enterprises,
its owners, programmers, and subsidiaries from any and all
liability that might arise from its use or misuse. This copyright
notice MUST remain in tact in order to legally use this script.
Removal and/or modification of the copyright notice voids registration.
*
This script is freeware and you are free to modify it, but you do
*NOT* have permission to redistribute or sell the code for
this program, nor claim it is your own. If you do use it, I would
sure appreciate a linkback to http://www.tdscripts.com/
INSTRUCTIONS:
1. Simply FTP this file to any image directory.
2. Call the file with your browser and it will cycle through all
images in that same directory.
*/
$img_directory = opendir(".");
while($img = readdir($img_directory))
{
$images[] = $img;
}
closedir($img_directory);
$size = count($images);
if ($sp > 0)
{
$image = $images[$sp];
if ($image == "")
{
print("You have reached the end of the images in this directory.");
print("</BODY></HTML>");
exit;
}
elseif ($image == "..") {
$sp++;
$image = $images[$sp];
}
elseif ($image == "image_viewer.php3") {
$sp++;
$image = $images[$sp];
if ($image == "")
{
print("You have reached the end of the images in this directory.");
print("</BODY></HTML>");
exit;
}
}
} else {
$break = explode(".", $image);
if(($break[1] == "gif") OR ($break[1] == "jpg") OR ($break[1] == "png"))
{
$image = $images[0];
if ($image == ".") { $image = $images[1]; $sp=1; }
if ($image == "..") { $image = $images[2]; $sp=2;}
}
}
print("<img src=\"$image\">");
print("<br>I am displaying picture file: <strong>$image</strong><br>");
$sp++;
?>
<form method="post" action="image_viewer.php3">
<input type="hidden" name="sp" value="<?print($sp);?>">
<input type="submit" value="Display Next Picture">
</form>
</BODY>
</HTML>
|