In reply to:
Is it possible to edit the Crontab with a php file?
Yes. The file that gets submitted to crontab is simply a *nix text file; if you're at all familiar with handling serial access files it shouldn't represent much of a fuss.
In reply to:
I'm working on project that allows users to create schedules in order to have specific information sent to them at specific times. The two methods I'm looking at to do this are:
1) when the user schedules a send-time, it is entered into the crontab, which will run the proper script at the proper time. This is the thing where I don't know if it will work, since I haven't found any information on dynamic automated crontab editing.
Again, the file you submit to crontab is just a (mildly formatted) text file. The catch with crontab is that submitting a file to the cron daemon for tabbing isn't cumulative; every time you add a new job you have to re-create the entire file and re-submit it (IOW, you can't just append the crontab).
In reply to:
2) when the user schedules a send-time, it is stored and the crontab runs a script every 10 minutes. That script essentially asks: "Is it time yet? Is it time yet? Is it time yet?" over and over until the time for the event actually comes.
Actually, it's exactly that sort of repetitive procedure that computers are real good for.
In reply to:
For my purposes, editing the crontab would be the easier solution, but I have no idea if it is possible.
It's possible, but probably not so very desirable. Fiddling with the cron daemon on a semi-constant basis may cause some nuisance, especially if two users are trying to read or write to the crontab file at the same time. Your second method of using the cron daemon to periodically check a multi-user accessible database for some timed event is probably the best and safest way to go. From an administrative point of view, it's much easier to pinpoint a problem in a database than to sift through (what might potentially be) a bulky textfile full of cron entries.