27 lines
499 B
PHP
27 lines
499 B
PHP
|
|
<?php
|
||
|
|
function randomImage ( $array ) {
|
||
|
|
$total = count($array);
|
||
|
|
$call = mt_rand(0,$total-1);
|
||
|
|
return $array[$call];
|
||
|
|
}
|
||
|
|
$tbs_images = array (
|
||
|
|
"rx2.jpg",
|
||
|
|
"rx2v3.jpg",
|
||
|
|
"phoromone-scent.jpg",
|
||
|
|
"koala-sexwear5.jpg"
|
||
|
|
|
||
|
|
);
|
||
|
|
|
||
|
|
// open the file in a binary mode
|
||
|
|
$name = randomImage($tbs_images);
|
||
|
|
$fp = fopen($name, 'rb');
|
||
|
|
|
||
|
|
// send the right headers
|
||
|
|
header("Content-Type: image/jpg");
|
||
|
|
header("Content-Length: " . filesize($name));
|
||
|
|
|
||
|
|
// dump the picture and stop the script
|
||
|
|
fpassthru($fp);
|
||
|
|
exit();
|
||
|
|
?>
|