Okay, so I'm not so experienced with PHP, and I've been searching for hours for a way to access an image file outside of the document root. I know there are many answers to this question, sort of, but none that actually helped me.
So what I have so far is a folder structure like this (ignore the odd file names):
-img
-imagez.php
-logo.php
-public_html
-files.php
I put this code inside of files.php
:
<?php include('/home/byonexco/img/imagez.php'); ?>
If I access files.php
from my browser, I see the content of imagez.php
, as is expected.
My problem is, I want to be able to do the same thing with the file logo.png
. The folder img
is not publicly accessible, so I know I have to call the image with PHP.
How can I get logo.png
to show on the page when someone accesses the file files.php
?