How to display images which are outside root in popup

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 6
Joined: Wed Apr 24, 2013 6:41 am

Wed Apr 24, 2013 9:03 pm

I have been trying to display images in a popup window. The images are not in root directory. I have tried javascript but it does not work. I tried writing a php script to which I pass the directory and image name and try to display it in another tab using hyperlink. But that page just displays garbage data.

I have been trying to solve this issue for 3 days but none of the solution seems to work.

Any help in this regard ? :help:

New php-forum User
New php-forum User
Posts: 20
Joined: Tue Mar 06, 2012 11:05 pm

Thu Apr 25, 2013 5:41 am


This can be a issue of image path. Please check whether you are giving the correct image path or not.


php-forum Fan User
php-forum Fan User
Posts: 974
Joined: Mon Oct 01, 2012 12:32 pm

Thu Apr 25, 2013 7:32 am

use file_exists() and is_readable() to make sure that both are true for the image file to be displayed, if they're not, then verify paths and permissions.

Post Reply