Executing CRON from a WebForm..
| From: | Andres Villalobos Camacho | Date: | Fri, 14 Nov 2003 21:52:19 +0000 |
| Subject: | Executing CRON from a WebForm.. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-169691@lists.php.net to get a copy of this message | ||
Hi!!.
I'm trying to give users the chance to modify its cron from a webform.
The webform let's the users choose the day, month and minutes after
hour, then, using PHP I made one long string and save it into a file
($tmpnam), it looks like this:
$content = "$min $hour $day * * /tmp/parse_maillog.sh"; //I obtain $min
$hour & $day earlier in my webform
$tmpfname = tempnam ("/tmp/mail", "$username_crontab.txt");
$handle = fopen($tmpfname, "w");
fwrite($handle, $content);
fclose($handle);
system("crontab -u $username $username_crontab.txt");
unlink($tmpfname);
Debugging this part I found that the file is OK, the problem is with the
"system" function, obviously a "user" problem, how can I fix it?? any
ideas?? I use phpSecurePages as an authentication system.
Thanx..
--
The explanation requiring the fewest assumptions is the most likely to
be correct. -- William of Occam