Skip to content

nowehity97/Random-image

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Random Image

this is a simple script to select images randomly from the folder you set, you can use it on your blog background, or your personal site, or anything you like =v=

Installation

just put all the files into your web folder (make sure you have PHP environment installed), then you can add your favorite images into imgs folder if you didn't change the default config.

Configure the script

the default image folder is named as imgs if you want to configure the default seeting, please refer to config.inc.php to modifiy your seetings.

Supported arguments:

  • IMG_DIR - the relative path for your images folder from your web server.
  • IMG_EXTENSIONS - the supported image file extension for your images.
  • IMG_NO_REPEAT_CURRENT - if set to true the next randomly selected image won't be same to the currently selected image, if set to false will ignore the currently selected image for next random select (so the repetitive selected image may occur).

How to import the image

you can directly call index.php to fetch the image, e.g. if this script is in your root web folder www/Random-image/ then you can access image via the url http://[your-ip]/Random-image.

About

an simple php script for select random image

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%