Monday, May 6, 2013

php - display image & security

Hi

I think you want to :
  1. deny access to the image/ directory
  2. put this script outside the image/ directory

    CODE --> show.php

    <?php
    header("Content-type: image/jpeg");
    readfile("image/$_GET[image].jpg");
    ?>
  3. access "/image/baby.jpg" with http://example/show.php?image=baby
Of course the simple solution would be to just set up your web server and do no programming. But probably I do not fully understand your idea.

No comments: