Please post about Dynamic Drive Scripts in the Dynamic Drive Scripts Help section here where I've moved this thread, and:
Warning: Please include a link to the DD script(s) in question in your post. See
this post for more information.
The script requires a PHP enabled server and will not run locally or on a server that's not PHP enabled. Are you running it on a PHP enabled server?
If not, you need to. However, if you are running it on a PHP enabled server, the getalbumpics.php is a little dated. Here's a more modern version:
PHP Code:
<?php
Header("content-type: application/x-javascript");
if (phpversion() >= 5.1){
@date_default_timezone_set(date_default_timezone_get());
}
function returnimages($dirname=".") {
$pattern='/\.(jpg|jpeg|png|gif|bmp)$/i';
$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);
}
}
$photovar=$_GET['id'];
if (!preg_match('/^[a-z_][a-z0-9_]+$/i', $photovar)){
echo 'alert("Photo Album ID must contain only letters, numbers, or underscore, and cannot start with a number")';
die();
}
echo "var $photovar={\n";
echo " baseurl: \"http://" . $_SERVER["SERVER_NAME"] . dirname($_SERVER['PHP_SELF']) . "/\",\n";
echo " images: [\n";
returnimages();
echo " ],\n";
echo " desc: []\n";
echo "}\n";
die();
?>
Try it. The browser cache may need to be cleared and/or the page refreshed to see changes.
If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
Bookmarks