Now of course you can only do this on a PHP enabled server that has certain file and directory functions enabled. That said, I also see that the supplied fpslideshowvar.php file has at least two potential problems (no formal opening php tag, and uses a deprecated method - eregi). Try this version:
PHP Code:
<?php
Header("content-type: application/x-javascript");
function returnimages($dirname=".") {
$pattern="/\.(jpg|jpeg|png|gif|bmp)$/i";
$files = array();
$curimage=0;
if($handle = opendir($dirname)) {
while(false !== ($file = readdir($handle))){
if(preg_match($pattern, $file)){
$filedate=date ("M d, Y H:i:s", filemtime($file));
echo " [$curimage, \"$file\", \"$filedate\"],\n";
$curimage++;
}
}
echo " [\"placeholder\"]\n";
closedir($handle);
}
return($files);
}
echo "var fpslideshowvar={\n";
echo " baseurl: \"http://" . $_SERVER["SERVER_NAME"] . dirname($_SERVER['PHP_SELF']) . "/\",\n";
echo " images: [\n";
returnimages();
echo " ],\n";
echo " desc: []\n";
echo "}\n";
?>
If you want more help, please supply a link to the page on your site that has the problematic code.
Bookmarks