Hi all
i have my whole codeigniter placed outside my root except for the assets (css,js)
i use a php script to display my images in the view like so
the image.php contents look like this
I would like to prevent a non logged on user to link to my images using the url:
https://mydomaine.be/image.php?img=avatar.png
is there a way to do this.
i have tried placing code inside the image.php (if ci loggedinuser bla bla) but i dont have access to the CI core inside my image.php so dont work.
by the way the image.php is in the root. (http://www.mydomain.be/image.php)
what would be the best way to achieve this
thanks to all
i have my whole codeigniter placed outside my root except for the assets (css,js)
i use a php script to display my images in the view like so
Code:
<img class="img-circle" src="../image.php?img=me.jpg" alt="">the image.php contents look like this
PHP Code:
<?php
header('Content-Type: image/jpg');
readfile("../images/" . $_GET['img']);
?>https://mydomaine.be/image.php?img=avatar.png
is there a way to do this.
i have tried placing code inside the image.php (if ci loggedinuser bla bla) but i dont have access to the CI core inside my image.php so dont work.
by the way the image.php is in the root. (http://www.mydomain.be/image.php)
what would be the best way to achieve this
thanks to all