Que tal,
Nunca lo he hecho pero ahí te dejo un link que pillé hace mucho tiempo
http://egov.sec.state.ri.us/howto/my...plication/view
Lo segundo que necesitas se llama cron jobs o "tareas programadas", esto es más hacia el servidor web e incluso sistema operativo.
http://programacion.net/php/articulo/adr_phpcron/