cron doesn't want to work with your files. It has a list of entries per user, and you can submit that list of entries to it by editing a file, but it's his list, not yours; and there's not an option to specify multiple lists.
What you want to do constitutes a horrible security risk, but that's already implied when you're working with PHP, so I'll just mention it briefly here and shut up about it.
You can let each of your users edit his/her own file. You assign a file name to each user and give them some access to it so they can edit it. But just as crontab
provides the capability to update its table when you do crontab -e
, you'll have to provide some functionality to update the crontab list once the user has finished editing his file. You could provide a CGI or PHP script to do this from their browser, if you want.
This script will need to merge all the existing user files into one (cat
will mostly take care of this, you only need to make sure each file ends with a newline), and then you can use crontab <file>
to update the combined crontab from the latest version of the combined file.