All pastes #425148 Raw Edit

Someone

public text v1 · immutable
·published 2007-04-05 08:54 UTC
rendered paste body
<?php

// seed with microseconds - nabbed straight off php.net
function make_seed()
{
  list($usec, $sec) = explode(' ', microtime());
  return (float) $sec + ((float) $usec * 100000);
}
mt_srand(make_seed());

$source = "./"; //In which folder are the sigs located? Type "./" for the same folder as this file.

//-----------Don't touch below this line-----------//

$handle=opendir($source);
$i = 0;
$sigs = array();
while (false!==($file = readdir($handle)))
{
if ($file != "." && $file != ".." && eregi ( "(gif|png|jpg)" , $file ) )
{  
    $sigs[$i] = "$file";
    $i = $i + 1;
   }
}

closedir($handle);

$sig = $sigs[mt_rand(0, count($sigs)-1)];

@header ("Location: $source/$sig");

?>