Get your list here!'; } else { if ($code == '') { echo 'No code given!'; exit; } else { $fname = "/var/www/vhosts/megadelfi.com/sweph/astlist_".$code.".pdf"; $fname = "/var/www/vhosts/megadelfi.com/sweph/astlistuus4_".$code; if (file_exists($fname)) { $INFO = fopen($fname,"r"); $pdfdata = fread($INFO,filesize($fname)); fclose($INFO); $len = strlen($pdfdata); mysql_connect("localhost", "megadel_abhi", "Trustn02!!"); mysql_select_db(megadel_horoskoop); $sql = "SELECT day, month, year, time FROM astorders WHERE code = '".$code."'"; $result = mysql_query ($sql); while ($data = mysql_fetch_row($result)) { $suffix = $data[0].".".$data[1].".".$data[2]."-".$data[3]; } header('Location: http://'.$_SERVER['HTTP_HOST'].'/asteroids/asteroidspdf.php?title='.$suffix.'&code='.$code); exit; header("Content-type: application/pdf"); //header("Content-Type: application/octet-stream"); // header("Content-Type: application/force-download"); header("Content-Length: $len"); header("Content-Disposition: attachment; filename=astlist-".$suffix.".pdf"); // header("Content-Transfer-Encoding: binary"); echo $pdfdata; } else { echo 'List not ready yet!

'; $fname = "/var/www/vhosts/megadelfi.com/sweph/astlist_".$code; if (file_exists($fname)) { $size = filesize($fname); // echo 'file size is: '.$size.'
'; // echo 'needed size: '.$fullfile.'
'; // $fullfile = $fullfile / 100 * 120; $proc = $size / ($fullfile / 100); $proc = number_format($proc,2); echo 'calculated '.$proc.'%'; } } } } ?>