I'h currently developing the application on localhost...so it wont be possible to access it from outside...but here is my entire code for image page:
session_start();
error_reporting (E_ALL ^ E_NOTICE);
if(!empty($GET['id'])){
$Person_Id=$GET['id'];
}
if(empty($_GET['id'])){
$Person_Id="";
}
$Person_Name=$SESSION['Person_Name'];
//$SESSION['Person_Last_Name']= $Person_Last_Name;
$Person_City=$SESSION['Person_City'];
$Person_State=$SESSION['Person_State'];
$Current_Id=$_SESSION['$Current_Person_Id'];
//include('global_vars.php');
$dbServer='localhost';
// username and password to log onto db server
$dbUser='XXX';
$dbPass='XXXXX';
// name of database
$dbName='XXXXX';
$link = mysqli_connect("$dbServer", "$dbUser", "$dbPass") or die("Could not connect");
// print "Connected successfully<br>";
mysqli_select_db($link,"cpool") or die("Could not select database");
//if($_GET['id']==$Current_Id){
//$result = mysqli_query($link,"select * from person where Person_Id=$Current_Id and Person_Name='$Person_Name'");
$result = mysqli_query($link,"select Photo_Content,Photo_Name,Photo_Type,Photo_Size from person where Person_Id='$Person_Id'");
////starting the inner validation
//else if($result){
$row_count=0;
while($row = mysqli_fetch_array($result))
{
//$row_color = ($row_count % 2) ? $color1 : $color2;
$content=$row["Photo_Content"];
$name=$row['Photo_Name'];
$type=$row['Photo_Type'];
$size=$row['Photo_Size'];
//print_r(array_keys($row));
$row_count++;
}
// print_r(array_keys($row)) ;
//header("Content-length:$size");
header("Content-type:$type");
//header("Content-Disposition:filename=$name");
//header('filename=$name');
//Content-Disposition: attachment;
echo $content;