protect folder only

Started by websmoker, July 27, 2020, 12:40:44 AM

websmoker

Hi, i want to use the php user login.
It is not to protect the total webshop.
i have a folder /directory full of .jpg files
before loding it, there should be a login for users. The pictures have wine and tobacco and will be forbidden to show .

the folder name is ( as in google) x1x and is my root
the link to the .jpg is:
www.domain.com/contents/x1x/picture.jpg
The link is automaticalli pulled in to the shop after loading

Question:
can i use the php script before the link s are loaded? i am affraid the jpg load already before the user is at the shop.

hope someone has a suggestion
thnx



zubrag

You could forbid direct access. Here is example for apache
https://stackoverflow.com/questions/40158651/how-to-prevent-direct-access-to-files-but-allow-files-in-webpages