Using the following to force cache images on page, throws error and dies without grace.
At first I thought it wasn’t reading the directory but, it seems like its there (judging from
first error). I was thinking that maybe it had something to do with $diro=pictures/ ???
No idea…. I tried echoing array at the end of my while string and just gave me another
error….. It all “Seems” vaild.
[code]
<?php
$hds=”images/products/lighting/”;
$src=”images/products/lighting/pearl/”;
$img=”images/products/lighting/pearl/searchlight/”;
$url=”layers/lighting/pcons/”;
$noimg=”images/”;
$dir = dir($img);
while($temp = $dir->read())
{
$dirarray[] = $temp;
}
print j_array($dirarray);
function j_array($var){
$javastr = “<script language=”javascript”>”;
$javastr .= “var d = new Array();”;
$diro=”Pictures/”;
while(list($key, $val) = each($var)){
$javastr .= “d[$key] = new Image();”;
$javastr .= “d[$key].src = ‘$diro$val’;”;
}
$javastr .= “</script>”;
return $javastr;
}
?>
And Error
[quote]
Warning: dir([url]http://omnisistem/images/products/lighting/pearl/searchlight/
Fatal error: Call to a member function on a non-object in /home/content/o/m/n/omnisistem/html/layers/lighting/prl-sl.php on line 9