Hi !
How can i display an image on my webpage which i located above webscope? The image is located at /home/image.jpg and the website is located at /home/www/example.com/index.php which refers to http://example.com/.
I have tried this code to retrieve the image, but it does not work :(
header('Content-type: image/jpeg'); readfile( realpath( "/home/image.jpg" ));
And I have tried this version too:
header('Content-type: image/jpeg'); $image = imagecreatefromjpeg( realpath('../../image.jpg')); // OUTPUT IMAGE AND FREE MEMORY imagejpeg($image); imagedestroy($image);
When I try to read the file with this code:
fopen( realpath( "../.." ) . '/image.jpg', 'r+' );
It returns this error
Warning: fopen(/home/image.jpg) [function.fopen]: failed to open stream: No such file or directory in /home/www/example.com/image.php on line 4
Can anyone please help me? I am getting desperate!!!!!
Thanks in advance.