|
|
|
Store all your images that you want to display in the same folder you specified
above. DO NOT store anything you do not want to display such as files.
This script reads the entire folder you specify and displays the contents at random
If you want to retain the size of the images, add a width to the last line
|
<?php
$Image_Path = "/path/to/site/root"; // Root Path - no slash on end
$Image_Folder = "Images"; // Directory name of the folder storing your images
srand((double) microtime() * 10000000);
$imgdirpath = opendir("$Image_Path/$Image_Folder");
while (false !== ($imgfile = readdir($imgdirpath))) {
if ($imgfile != "." && $imgfile != "..") {
$imgpath = "$Image_Path/$Image_Folder/$imgfile";
$imageimg[$imgfile] = basename($imgpath);
}
}
closedir($imgdirpath);
shuffle($imageimg);
list( ,$img_value) =each($imageimg);
echo "<img src=\"$Image_Folder/$img_value\">\n";
//============================================================
?> | | |
|
| upload function using PHP's FTP abilities. Categories : PHP, Filesystem, HTML and PHP | | | Creating thumbnails from MySQL Blobs online Categories : PHP, MySQL, Graphics, HTML and PHP, Databases | | | Directory TreeView - File Manager & Explorer - FTP - Utility - PHP/HTML - Categories : PHP, Directories, FTP, Filesystem, HTML and PHP | | | Snipe.Net's Web Design Color Scheme Previewer- Allows uses to input hex
codes for their text, background, and link colors, and preview the color
scheme with their background image. Example:
http://www.snipe.net/tech/snipeschool/hex.php3 Categories : PHP, HTML and PHP, General, Graphics, HTML | | | webcam cam view image ispy browser independant Categories : Graphics, HTML, HTML and PHP, PHP | | | Barcodes On The Fly With GD Categories : Ecommerce, Graphics, HTML and PHP, PHP | | | This program implements hot link prevention in php. It is useful for webmasters who do not have access to the server at a level where they can control hot linking can still supply some type of hot link prevention for thier site by using php. Categories : PHP, Filesystem, Graphics, Content Management | | | Read DPI value from image with PHP Categories : PHP, Graphics, Filesystem | | | Opening and formatting text files into HTML on the fly- or HTML from templates. Categories : PHP, HTML and PHP, Filesystem | | | This is a simple photo gallery that reads the image files from multiple directories, and generates a web page styled with CSS1. It opens single auto window to view and print a given image.
Categories : Graphics, Filesystem, PHP, Complete Programs | | | Easy slideshow with php. Just place this one file into a subdirectory where jpg files reside. An instant slideshow is yours. MS explorer only. Categories : PHP, Filesystem, Graphics | | | Handle multiple file upload Categories : Complete Programs, Filesystem, PHP, HTML and PHP | | | Directory viewer, customize how you display the file structure, easy to
understand. Found out about PHP 3 days ago, and this is my first prog. Categories : HTML and PHP, Complete Programs, Directories, Filesystem, PHP | | | Simple image counter Categories : PHP, Graphics, Filesystem, Beginner Guides | | | This script will read all images from a folder and read the files into an array. It uses rand() to get a random number. It will display a random image from the image folder given. Categories : PHP, Arrays, Graphics, Filesystem | |
| | | | Saravanan .R wrote : 1157
Hi,
Iam an Winodows Users. I have Apache 1.3.x and PHP 4.3.x. this code doesn`t work for the above environment.
| | | | Ron FREDERICK wrote :1159
This was developed using Apache and built using windows XP.
| |
|
|