I am a php newbie, confused about how to start this script ...
what do I replace 'pwd' with? Tried the images folder and everything else??? Thanks for Your Help!
$dir = exec('pwd');
$open_dir = opendir("$dir");
$image_ext_array = array(
"jpg",
"gif",
"JPG",
"GIF",
);
$image_files = array();
if(!$open_dir){
die("can not open!$dir");
}
else{
$show_img = array_rand($image_files);
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, no-store, must-revalidate, private, max-age=0, proxy-revalidate, no-transform");
header ("Pragma: no-cache");
header ("Vary: User-Agents");
$image_alt = "New at Michael Gordon Innovations!";
$image_location = $dir . "/" . $image_files[$show_img];
$image_width = getimagesize($image_location);
$image_height = getimagesize($image_location);
echo "<img src=\"$image_files[$show_img]\" width=\"$image_width[0]\" height=\"$image_height[1]\" alt=\"$image_alt\">";
header ("location: http://mglcorp.com/site/whatsnew/$image_files[$show_img]");
}