\n\n\nLogin\n\n\n\n"; // $footstr="

 \n\n\n \n\n\n"; // $txtstr="
\n"; // $txtstr.="\n"; // $silent="yes";$numcols=1; // include("frm_header.php"); // $txtstr.=$theheaderstr; // $txtstr.="\n\n\n
Forum Index / Forum download


"; $headstr = ""; $footstr = ""; $txtstr = ""; include("../database/connectdb.php"); $result = mysql_query("SELECT filenaam,orgnaam,filetype,grootte from forumuploads where id='".$id."' and actief='ja' limit 1"); if (!$result) { die($headstr.$txtstr."Error 678: No response from database.

".mysql_error()."

".$footstr); } $max_rows = mysql_num_rows($result); if ($max_rows<=0) { die($headstr.$txtstr."Error 679: File not found in database.

".mysql_error()."

".$footstr); } $row = mysql_fetch_array($result); mysql_free_result($result); $basedir=$myhomedir."/forum/uploads/"; $file=$row["filenaam"]; if (!file_exists($basedir.$file)) { die($headstr.$txtstr."404 Error: File not Found!".$footstr); } if (!headers_sent()) { // header("Content-type: application/octet-stream"); $path=pathinfo($basedir.$file); $dirname=$path["dirname"]; $filename=$path["basename"].".".$row["filetype"]; // $extension=$path["extension"]; $fsize=$row["grootte"]; switch ($row["filetype"]) { case "zip": $ContentType = "application/zip"; break; case "rar": $ContentType = "application/rar"; break; case "jpg": $ContentType = "image/jpeg"; break; case "png": $ContentType = "image/png"; break; case "gif": $ContentType = "image/gif"; break; case "ppt": $ContentType = "application/vnd.ms-powerpoint"; break; case "doc": $ContentType = "application/msword"; break; case "xls": $ContentType = "application/vnd.ms-excel"; break; default: $ContentType = "application/zip"; } header("Content-Type: ".$ContentType); if(preg_match("/MSIE 5.5/", $_SERVER["HTTP_USER_AGENT"])) { header("Content-Type: ".$ContentType); header("Content-Disposition: filename=".rawurlencode($row["orgnaam"])); } else { header("Content-Type: ".$ContentType); if ($_GET["forcedownload"] == 1) { header("Content-disposition: attachment; filename=".rawurlencode($row["orgnaam"])); } else { header("Content-disposition: inline; filename=".rawurlencode($row["orgnaam"])); } } header("Content-Length: ".$fsize); $fd = fopen ($basedir.$file, "rb"); $contents = fread ($fd, $fsize); fclose ($fd); if (!headers_sent()) { echo $contents; $result = mysql_query("update forumuploads set dlcount=dlcount+1 where id='".$id."' limit 1"); $result = mysql_query("update users set downloads=downloads+1 where id='".$_COOKIE["cuserid"]."' limit 1"); } else { echo $headstr.$txtstr."Error 87872: Error opening requested file: ".$basedir.$file.$footstr; } } ?>