Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host="127.0.0.1";
- $user="user";
- $pass="pass";
- $database="database";
- $table="table";
- $expire="50"; // expire time in seconds
- $basepath="/drftpd/site"; // fd
- function fucking_php_suck_my_ballz($lala) {
- $w=round($lala/604800);
- $d=(($lala / 3600) / 24) % 7; $h=($lala / 3600) % 24;
- $m=($lala / 60) % 60; $s=$lala%60;
- $foutf=$s." secs";
- if ( $m ) $foutf="$m mins ".$foutf; if ( $h ) $foutf="$h hrs ".$foutf;
- if ( $d ) $foutf="$d days ".$foutf; $foutf="$d days ".$foutf;
- return $foutf; }
- function check_valid($t) { $tt=time()-$t; if ($tt > $expire) return $tt; else return 0;}
- $db=mysql_connect($host, $user, $pass);
- if(!$db)
- die(mysql_error());
- $db=mysql_select_db($database);
- if(!$db)
- die(mysql_error());
- $nh = $_GET['n'];
- if ( $nh )
- {
- $res=mysql_query("SELECT * FROM $table WHERE nfo_hash ='$nh'");
- if(mysql_num_rows($res) > 0)
- {
- $row=mysql_fetch_array($res);
- $tchk=check_valid($row['unixtime']);
- if ( $tchk == 0 ) {
- if ( $_GET['dl'] == "y" )
- {
- $file1="$basepath/{$row['nfo_rlsname']}/{$row['nfo_filename']}";
- header("Content-type: application/force-download"); header("Content-Transfer-Encoding: Binary");
- header("Content-length: ".filesize($file1));header("Content-disposition: attachment; filename=\"".basename($file1)."\"");
- header('Content-Transfer-Encoding: binary'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
- header('Expires: 0'); readfile($file1);
- }
- else
- {
- echo str_replace("\n", "<br>", $row['nfo_data']);
- }
- }
- else if ( $tchk > 0 ) {
- echo "This Link Expired ".fucking_php_suck_my_ballz($tchk-$expire)." ago ";
- }
- }
- else
- {
- echo "Nothing found";
- }
- }
- else
- {
- echo "No input";
- }
- ?>
Add Comment
Please, Sign In to add comment