Automatically run demo.mysql.php using cron

The place for "I can't figure out how to..." questions.
Post Reply
Posts: 1
Joined: Fri Jun 24, 2011 4:55 pm
Are you a spambot?: no

Automatically run demo.mysql.php using cron

Post by feyip » Fri Jun 24, 2011 5:24 pm

I've got the demo.mysql.php running such that all I need to do is type the page title with the search parameters (demo.mysql.php?newscan=folder) to add files to the table, but given that that's there is only one folder I want to use I'm trying to change it from a form asking for directories to simple checking the directory so I can run it using cron.

As far as I can see it should be a simple job of changing:

echo '<hr><form action="'.FixTextFields($_SERVER['PHP_SELF']).'">';
echo 'Re-scanning a new directory will only add new, previously unscanned files into the list (and not erase the database).<br>';
echo 'Directory: <input type="text" name="newscan" size="50" value="'.FixTextFields(!empty($_REQUEST['newscan']) ? $_REQUEST['newscan'] : '').'"> ';
echo '<input type="SUBMIT" value="Go">';
echo '</form><hr>';
echo '<ul>';

so newscan=folder, and removing the form and SUBMIT section so it automatically runs when run, but it's not working.
Can anyone correct the code so demo.mysql.php can be run using cron?


Post Reply