Creating a file using CGI/PHP


I want to be able to give a command in the shell (or even better automate for monthly execution) to trigger a script. This script would then take some data from mySQL and write a html or text file.

I know how to query the DB ect, but how do I execute the command, how do I tell the script to create a file on the server?

As you can probably tell I’m not too sure where to start with this, any help would be greatly apriciated.


You can run a script on an automated job (scheduled task) through cron on the unix system. Do a man on cron and crontab to see their info. Cron is unix’s version of windows’ scheduled tasks.

As for using PHP to execute a command, that can be done through the system command or alike.

Thanks. That’ll get me started, I know nothing about Unix so I was a bit lost.