Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

tanel

By: a guest on Aug 16th, 2009  |  syntax: None  |  size: 0.29 KB  |  views: 353  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         $id = md5(time().microtime()+$_SERVER['HTTP_USER_AGENT']);
  2.         $i = 4;
  3.         while($i<32){
  4.                 $i++;
  5.                 $k2 = substr($id,0,$i);
  6.                 $q = "SELECT count(id) FROM url where id = '$k2';";
  7.                 $res = $c->q($q);
  8.                 $fetch = mysql_fetch_array($res);
  9.                 if($fetch[0] == 0){
  10.                         $id = $k2;
  11.                         break;
  12.                 }
  13.         }