Guest User

Untitled

a guest
May 5th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. <?php
  2. $host="127.0.0.1";
  3. $user="user";
  4. $pass="pass";
  5. $database="database";
  6. $table="table";
  7. $expire="50"; // expire time in seconds
  8. $basepath="/drftpd/site"; // fd
  9.  
  10. function fucking_php_suck_my_ballz($lala) {
  11. $w=round($lala/604800);
  12. $d=(($lala / 3600) / 24) % 7; $h=($lala / 3600) % 24;
  13. $m=($lala / 60) % 60; $s=$lala%60;
  14. $foutf=$s." secs";
  15. if ( $m ) $foutf="$m mins ".$foutf; if ( $h ) $foutf="$h hrs ".$foutf;
  16. if ( $d ) $foutf="$d days ".$foutf; $foutf="$d days ".$foutf;
  17. return $foutf; }
  18. function check_valid($t) { $tt=time()-$t; if ($tt > $expire) return $tt; else return 0;}
  19.  
  20. $db=mysql_connect($host, $user, $pass);
  21. if(!$db)
  22. die(mysql_error());
  23. $db=mysql_select_db($database);
  24. if(!$db)
  25. die(mysql_error());
  26.  
  27. $nh = $_GET['n'];
  28.  
  29. if ( $nh )
  30. {
  31. $res=mysql_query("SELECT * FROM $table WHERE nfo_hash ='$nh'");
  32.  
  33. if(mysql_num_rows($res) > 0)
  34. {
  35. $row=mysql_fetch_array($res);
  36. $tchk=check_valid($row['unixtime']);
  37.  
  38. if ( $tchk == 0 ) {
  39. if ( $_GET['dl'] == "y" )
  40. {
  41. $file1="$basepath/{$row['nfo_rlsname']}/{$row['nfo_filename']}";
  42. header("Content-type: application/force-download"); header("Content-Transfer-Encoding: Binary");
  43. header("Content-length: ".filesize($file1));header("Content-disposition: attachment; filename=\"".basename($file1)."\"");
  44. header('Content-Transfer-Encoding: binary'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  45. header('Expires: 0'); readfile($file1);
  46. }
  47. else
  48. {
  49. echo str_replace("\n", "<br>", $row['nfo_data']);
  50. }
  51. }
  52. else if ( $tchk > 0 ) {
  53. echo "This Link Expired ".fucking_php_suck_my_ballz($tchk-$expire)." ago ";
  54. }
  55. }
  56. else
  57. {
  58. echo "Nothing found";
  59. }
  60. }
  61. else
  62. {
  63. echo "No input";
  64. }
  65. ?>
Add Comment
Please, Sign In to add comment