I seem to have a problem in my PHP code, whenever I access the file in my browser, it automatically downloads the file, when it should instead display the file. Here's my code:
<?php
$fileID = $_GET['f'];
require("GetMime.php");
$con = mysql_connect("localhost","root","password");
if (!$con){
die("Coulnd't connect to serer: ". mysql_error());
}
mysql_select_db("DownloadCenter",$con);
$FileID = mysql_query("SELECT FileSRC FROM FileCenter WHERE FileKEY = '$fileID'");
$result = mysql_fetch_array($FileID);
$FMime = checkMime($result['FileSRC']);
if (file_exists($result['FileSRC'])){
$contents = file_get_contents($result['FileSRC']);
header('Content-type: '. $FMime);
echo $contents;
}
?>