|
Posted by Dave Kelly on 09/28/39 11:52
Rik wrote:
> I know that EV1 runs PHP because I have the SMF code running. I just
>> need to check and see what hooks to scheduling they have.
>
> HTML: <img src="/path/to/dir/random.php" />
>
> random.php:
> <?php
>
> $dh = opendir(dirname(__FILE__));
>
> $images = array();
> $img_extensions = array('jpeg','jpg','png','gif');
>
> while (($file = readdir($dh))!==false){
> if(is_file(dirname(__FILE__).'/'.$file)){
> preg_match('/([^.]*)$/si',$file,$matches);
> if(in_array(strtolower($matches[1]),$img_extensions)){
> $images[] = $file;
> }
> }
> }
> closedir($dh);
> $chosen ='./'.$images[rand(0,count($images)-1)];
> $size = getimagesize($chosen);
> header("Content-type: {$size['mime']}");
> readfile($chosen);
> ?>
>
> Grtz,
I did not intend for you to do my work for me, but since you were kind
enough. THANK YOU.
Navigation:
[Reply to this message]
|