WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Random Image Display
Categories : PHP, Filesystem, Graphics, HTML and PHP Click here to Update Your Picture
Ron FREDERICK
Date : Jul 23rd 2004
Grade : 3 of 5 (graded 6 times)
Viewed : 8679
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Ron FREDERICK
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 


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";
//============================================================
?>



Creating thumbnails from MySQL Blobs online
Categories : PHP, MySQL, Graphics, HTML and PHP, Databases
webcam cam view image ispy browser independant
Categories : Graphics, HTML, HTML and PHP, PHP
Functions for loading images into a MySQL database and displaying them.
Categories : Graphics, HTML and PHP, MySQL, PHP, Databases
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
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
Upload images restricted by pixel size (Picture width and Picture Height)
Categories : PHP, HTML and PHP, Graphics
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
PHPixel - output of 1 pixel transparent/colored gif for counters etc.
Categories : PHP, Graphics, HTML and PHP
How to let a user download a picture by clicking on it instead of needing to right click and Save-As.
Categories : HTTP, PHP, HTML and PHP, Filesystem
upload function using PHP's FTP abilities.
Categories : PHP, Filesystem, HTML and PHP
Barcodes On The Fly With GD
Categories : Ecommerce, Graphics, HTML and PHP, PHP
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
Simple PHP/3 Access Counter (using GD and DBM functions)
Categories : Databases, PHP, Graphics, HTML and PHP, dBase
Opening and formatting text files into HTML on the fly- or HTML from templates.
Categories : PHP, HTML and PHP, Filesystem
Handle multiple file upload
Categories : Complete Programs, Filesystem, PHP, HTML and PHP
 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.