thanks, that's highly useful... so i got this far... this is the script i have so far:
$banner_File = "header_images.txt" ;
$total_Bannersize = 15 ;
$rnd_Value = GetRandomValue(0, $total_Bannersize-1);
function getFileline($filename, $line_number) {
$fp = @fopen($filename, "r");
$lnCounter = 0;
while (!feof ($fp)) {
$data = fgets($fp, 1024);
If ($lnCounter == $line_number){
$right_data = $data;
return $right_data;
break;
}
$lnCounter++ ;
}
}
function GetRandomValue($min, $max){
$mtime = ((double)microtime()* 100000);
$mtime = explode(" ", $mtime);
$mtime = doubleval($mtime[1]) + doubleval($mtime[0]);
mt_srand($mtime);
$randval = mt_rand($min, $max);
return ($randval);
}
$banner_Data = getFileline($banner_File, $rnd_Value) ;
$Banner = split("::",$banner_Data);
$BannerImageFullPath = "http://localhost/images/norcal/headers/" . $Banner[0];
echo $BannerImageFullPath;
$bin = fopen ($BannerImageFullPath, "rb");
$size = getimagesize($BannerImageFullPath);
if ($size && $bin) {
header("Content-type: {$size['mime']}");
fpassthru($bin);
}
fclose ($bin);
exit;
but it gives me the following errors:
Notice: Undefined offset: 1 in c:\inetpub\forum\main\hearder_images.php on line 28
http://localhost/images/norcal/headers/banner_04.jpg
Warning: fopen("http://localhost/images/norcal/headers/banner_04.jpg ", "rb") - No error in c:\inetpub\forum\main\hearder_images.php on line 39
Warning: getimagesize: Unable to open 'http://localhost/images/norcal/headers/banner_04.jpg ' for reading. in c:\inetpub\forum\main\hearder_images.php on line 41
Warning: fclose(): supplied argument is not a valid File-Handle resource in c:\inetpub\forum\main\hearder_images.php on line 47
what can i do to fix this?