I followed solutions pulled right from this site, and it still won’t work!
<?php
$x='/var/image.jpeg';
if(file_exists($x))
{
header('Content-Type: image/jpeg');
readfile($x);
}
?>
And nothing outputs…no error, no anything.
The directory is valid. Without the header file, it just displays text similar to the following
ÿØÿàJFIF``ÿáXExifMM*1>QQQAdobe ImageR
so i presume readfile works. With the header file, nothing gets displayed, just a blank page.
Any clues? Much help appreciated.
use imagejpeg function instead of readfile
and secondly if you have a file stored with you why would you like to display it with php and not with html img src