Advertisement
Guest User

tanel

a guest
Aug 16th, 2009
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement