Hi there,
I have images stored on the web server in the filesystem, which I need to retrieve and display in the browser.
The problem is that they should only be accessible through my script, which in turn is protected by a login/password system - and not by typing in the url in the browser.
Vincent suggested I use fopen. But I can\'t get it to work.
I tried this:
$filename= \"images/admin/1/3.jpg\";
$fp = fopen($filename,\"rb\");
$contents = fread ($fp,filesize($filename));
echo $contents;
Which works fine on my local machine, but doesn\'t on the webserver.
Anyway I am not sure if the direction I am heading is even right.
Any ideas as to how this can be solved? Someone must have done it before 🙂
As you can see I don\'t know a whole lot about php (or webservers for that matter)... just getting started.
Toby