View Single Post
  #6  
Old 12-29-2001, 02:42 AM
Uranium-235's Avatar
Uranium-235 Uranium-235 is offline
Administrator
 
Join Date: Nov 2001
Location: Mansfield, TX
Posts: 2,469
Send a message via ICQ to Uranium-235 Send a message via AIM to Uranium-235
Default Re: I'm moving my Personal PIC to my sig

oh yeah. here's the source, for those of you who want it
--------------------------------------------------
Code:
<?php
header("content-type: image/jpg"); //netsmog forum dosent like that first ", the & quot is a "
header("Cache-Control: no-store, no-cache, must-revalidate");  
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); 

//RandomIMG
//]MX[Uranium-235

function loadimage($filename)
{
      $file = fopen($filename, "rb");
      fpassthru($file);
      fclose($file);
}

$mdir = "images/$catagorey";

if(trim($catagorey) == "")
      loadimage("images/error.jpg");

if(!$dir = @opendir($mdir))
      loadimage("images/error.jpg");

while($file = readdir($dir))
{
      if($file != ".." && $file != ".")
            $imgs[] = $file;
}

closedir($dir);
mt_srand(time());
$num_img = count($imgs)-1;

//patched - mt_rand will not accept (0, 0)
if($num_img <= 0)
      $rand = 0;
else
      $rand = mt_rand(0, $num_img);

$images = $mdir . "/" . $imgs[$rand];


loadimage($images);

?>
__________________
PHP...It kicks ASP
Reply With Quote