//mysql_pconnect("db.news-piromedia.com", "news192", "j2T7mRpp");
mysql_pconnect("localhost", "piro", "pir0p0st");
mysql_select_db("screenpost");
if ($nb_id&&doc_id) {
list($code,$file_name,$file_size,$openbaar)=mysql_fetch_row(mysql_query("SELECT code,file_name,file_size,openbaar FROM doc WHERE klant_code='$nb_id' AND code='$doc_id'"));
if (!$code) {echo "
Het door u opgevraagde document is niet beschikbaar
";exit();}
else {
$openbaar=$openbaar?$openbaar:"0";
$ts=mktime(date('h:i:s m-d-Y'));
mysql_query("INSERT INTO doc_stat SET file_code='$code',klant_code='$nb_id',file_size='$file_size',file_name='$file_name',ts='$ts',openbaar='$openbaar'");
if ($openbaar!="0") {header('Location: ./doc_dir_'.$nb_id.'/'.rawurlencode($file_name).'');exit();}
if ($openbaar=="0") {header('Location: ./doc_dir_'.$nb_id.'_/'.rawurlencode($file_name).'');exit();}
}
}
?>