drjk87189 2010-07-16 15:11
浏览 88
已采纳

PHP拍卖到期跟踪[关闭]

What is the best way to send e-mails or perform functions on a small, non-real money auction script? This script is a learning exercise for me and I was wondering what the best way would be to process actions when the auction has expired. A cron job every minute seems - to me - a method which can easily be surpassed.

  • 写回答

1条回答 默认 最新

  • doujiong3146 2010-07-16 15:18
    关注

    To be honest, this is an ideal situation for a cronjob. Theoretically, you could create cronjobs on the fly...That is edit the crontab with php and create an entry for each auction with their end time to execute a generic script that has some variables passed to it.

    A cronjob every minute seems a bit extreme, but if you space it out a bit the idea seems very reasonable.

    Alternatives would be for if someone hits the auction page that the script checks to see if the auction is expired and then sends an email and sets a flag in a table column. This overall is a terrible idea (What if no one visits the page for a few days).

    Ideally the cronjob is your best friend here. Now you can go with an hourly style cronjob or create a script that generates one time cronjobs on the fly. The best solution though would be a recurring cronjob (per 10 minutes perhaps?) and as it sends out an email for an auction, a flag is set in an column ie email_sent to 1 or something similar so that emails aren't resent erroneously.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)