Loop through folders

Hello everyone. I have a file system so structured:

client 1 / file.zip and file.txt
client 2/ file.zip and file.txt
client 3 / file.zip and file.txt
client 4 etc…

In the file.txt is stored an email adress.

I need to send an email to any client ( client1, client 2, etc ) with a donwload link for the corresponding file.zip. I want that the link could be used only for a period of time. So, looking around, I understood that the best way to do it , it’s to save in the database the path of file.zip, a date of expiration , an alphanumeric id, and , in my case , the adress email.
So , I don’t have any idea how to loop through the folders in order to save in the database a table like this:

id ---- path of file.zip , client 1 ------ email client 1, stored in file.txt ----- expiration date ------

id ---- path of file.zip , client 2 ------ email client 2, stored in file.txt ----- expiration date ------

id ---- path of file.zip , client 3 ------ email client 3, stored in file.txt ----- expiration date ------

Could you help me ?

Thank you

Well, you’ve already identified what it is you need to do - [quote=“diegosaggiorato, post:1, topic:289758”]
loop through the folders
[/quote]

So, I will point you towards [fphp]glob[/fphp] , and [fphp]file_get_contents[/fphp], and ask you to make an attempt at it.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.