I have a folder called pdf where user will upload pdf's in it,i want a php script which will run for every five minutes to read the pdf folder in order to check for the newly added files in that folder?and intimate to the admin that few files with the following file names are added,how can i do that using php
Asked
Active
Viewed 87 times
0
-
maybe this is helpful: http://stackoverflow.com/questions/540339/how-to-check-if-directory-contents-has-changed-with-php – user3415653 Jun 20 '14 at 10:01
1 Answers
0
php scripts cannot auto execute it only execute if there is request made to them..
a simple idea in your case could pe
1.write a php function with the logic to see if filesystem has changed and do the necessary
action(email/database update) on execution.
- place & call this function on your home page(index.php).

Ashish
- 332
- 1
- 8
-
-
it's not possible with every hosting provider so i will not suggest it a fullproof method – Ashish Jun 20 '14 at 10:06
-
True, but including in the index.php onevery request is bad. Use a little javascript that calls your 'cron.php' async. Just like drupal does it. this willl make sure that your users accessing your site do not notice a performance difference – Pinoniq Jun 20 '14 at 10:08