dsw8292301 2010-08-17 08:39
浏览 58
已采纳

如何在代码中实现cron(php)?

Maybe It's a stupid question, but I didn't find answer. I use a web-hosting startlogic.com. I asked employee about cron. They told me that they only have a feature in the control panel called "Schedule jobs" where I can manually put the job. But I need to do this from my web-application. For example, when I push button, I will receive a email notification after 1 month. How to implement this using php? Can my web-hosting provider do this or I need to change provider (if yes, what will you recommend?)

Thanks in advance.

  • 写回答

3条回答 默认 最新

  • dougou3871 2010-08-17 08:50
    关注
    1. Make a PHP script called cron.php (outside of your web root if possible).

    2. Set this to run regularly under "Schedule Jobs"

    3. Every time cron.php runs, it checks a database of jobs to see if any are due yet.

    4. If any are due, they are run.

    5. Once run, they are marked as such.

    6. To add new jobs to the list, just add a new row to the database with the details of the job and the due date.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题