Guest User

Untitled

a guest
May 5th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 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; if ( $w ) $foutf="$w weeks ".$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.  
  42. $file1="$basepath/{$row['nfo_rlsname']}/{$row['nfo_filename']}";
  43. if ( file_exists($file1) ) {
  44. header("Content-type: application/force-download"); header("Content-Transfer-Encoding: Binary");
  45. header("Content-length: ".filesize($file1));header("Content-disposition: attachment; filename=\"".basename($file1)."\"");
  46. header('Content-Transfer-Encoding: binary'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  47. header('Expires: $expire'); readfile($file1);
  48. }
  49. else
  50. {
  51. echo "File not found<br>";
  52. }
  53. }
  54. else
  55. {
  56. echo str_replace("\n", "<br>", $row['nfo_data']);
  57. }
  58. }
  59. else if ( $tchk > 0 ) {
  60. echo "This Link Expired ".fucking_php_suck_my_ballz($tchk-$expire)." ago ";
  61. }
  62. }
  63. else
  64. {
  65. echo "Nothing found";
  66. }
  67. }
  68. else
  69. {
  70. echo "No input";
  71. }
  72. ?>
Add Comment
Please, Sign In to add comment