Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // check this line first
- require '/home/solidarity/kr/bbs/include/common.php';
- echo "Worked! <P>";
- // comment out everything below
- /*
- $user="derp";
- $host="localhost";
- $password="herp";
- $database="dev";
- $connection = mysql_connect($host,$user,$password)
- or die ("couldn't connect to server"); $db = mysql_select_db($database,$connection)
- or die ("Couldn't select database");
- $query .= "SELECT donor FROM bbs_users WHERE id=".$pun_user['id'];
- $result = mysql_query($query, $connection) or die
- ("Could not execute query : $query ." . mysql_error());
- $show = $_GET['show'];
- echo "show : $show <p>";
- $ep = $_GET['ep'];
- echo "ep: $ep <p>";
- $directory = '/home/solidarity/private/krdl/';
- $show2 = $show.'/';
- echo "show2: $show2 <p>";
- // local file that should be send to the client
- $local_file = $ep;
- echo "local_file : $local_file <p>";
- $download = $directory.$show2.$local_file;
- echo "download: $download <p>";
- while($process=mysql_fetch_array($result)) {
- $donor=$process["donor"];
- echo "donor: $donor <p>";
- if($donor=="1") {
- echo 'inside if($donor=="1")';
- header('Content-Type: application/octet-stream');
- header('Content-Disposition: attachment; filename='.$download);
- header('Content-Transfer-Encoding: binary');
- header('Cache-Control: private');
- header('Content-Length: ' . filesize($download));
- ob_clean();
- flush();
- readfile($download);
- exit;
- }
- }
- */
- ?>
Add Comment
Please, Sign In to add comment