init commit
This commit is contained in:
23
slideshow.php
Executable file
23
slideshow.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?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
|
||||
?>
|
||||
Reference in New Issue
Block a user