saving an image from the browser issue
<p>I'm using code to print an image without showing the real path for it. But I have a problem when I want to save that image to my computer because its always show the PHP file name as the name for the image.</p>

<pre><code>$id = intval($_REQUEST["id"]);
$getimage = $db-&gt;query("select id,img from bbup where id='$id'");
$fetch_image = $db-&gt;fetch($getimage);
$filename = $fetch_image['img'];
if (!$id) {
    echo "Wrong Id";
    exit;
}
if (!file_exists($filename)) {
    echo "Image not found.";
    exit;
}
$aaa = SITE_URL . $filename;
$imginfo = getimagesize($aaa);
header("Content-type: " . $imginfo['mime']);
readfile($aaa);
</code></pre>

<p>The php file is <code>ppupload.php</code> and when I want to save the image (let's say it is a PNG image) in the dialog box the name of the file show ( ppupload.php.png ) and I want it to be the image itself.</p>

<p>The image path stored into the database like this: <code>folder/folder/filename.ext</code>.</p>
