24 lines
527 B
PHP
Executable File
24 lines
527 B
PHP
Executable File
<?php
|
|
// PHP section
|
|
|
|
// set some variables
|
|
// Image directory! fill in! relative to root
|
|
$imageDir = '/slideshow/';
|
|
define('SERVERPATH', $_SERVER['DOCUMENT_ROOT'].$imageDir);
|
|
define('HTTPPATH', 'http://'.$_SERVER['HTTP_HOST'].$imageDir);
|
|
|
|
// read the names of images from the image directory
|
|
$dir = opendir(SERVERPATH);
|
|
$javascriptArray = null;
|
|
$i = null;
|
|
while (false !== ($file = readdir($dir))) {
|
|
if (substr($file, -3) == 'jpg'){
|
|
$javascriptArray[$i] = $file;
|
|
$i = $i+1;
|
|
}
|
|
}
|
|
closedir($dir);
|
|
|
|
// Html section
|
|
?>
|