0

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

1

1 Answer 1

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.

  1. place & call this function on your home page(index.php).
Sign up to request clarification or add additional context in comments.

3 Comments

you can have cronjobs to automate execution
it's not possible with every hosting provider so i will not suggest it a fullproof method
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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.