if ($_GET['id']) {
require ("nfoget.php");
$_con = mysql_connect("localhost","root","Pp13983234$") or die("teste0");
mysql_select_db("pre",$_con) or die("teste1");
$sql = "SELECT rlsname, data, filename, md5 FROM nfodb WHERE md5='".$_GET['id']."' LIMIT 1";
$q = mysql_query($sql,$_con) or die("teste2");
$arr = mysql_fetch_row($q);
$file = "img/".$_GET['id'].".nfo";
if ($arr[0]) {
$b = fopen("nfo.nfo","w+");
fwrite($b,$arr[1]);
fclose($b);
$ascii2image = new ascii2image ();
$ascii2image->loadNFO ("nfo");
$ascii2image->loadFont ("tipo");
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($arr[2]));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;