doujiyan0031 2012-10-01 22:45
浏览 51

在浏览器启动的后台执行php脚本[关闭]

I am writing a php script to send mails to all the email addresses in a particular mailing list. The mails might run into thousands and the entire script can take even hours to execute. What I want is the once the user enter the mail details, body, subject etc and hits a button/link, the php script runs in background and the user is redirected to some page as soon as he hits the button/link.

In short the php script should be initiated from the browser but should run on the server even if the browser is closed.

Alternatively if a progress bar can be shown on redirected page using AJAX/Javascript but the php script should continue executing even if the browser is closed.

  • 写回答

3条回答

  • duanjiu4498 2012-10-01 22:50
    关注

    PHP is the wrong tool for the job. Set up a mailing list on a e-mail server (perhaps the same server), and from the browser hand the data to PHP via ajax, which should then send the e-mail (only once) to the mailing list.

    The e-mail software will take care of sending a copy to every subscriber of the mailing list.

    This is one of the most efficient ways of doing it.

    Some links which may help you do more research:

    Remember though, this has nothing to do with programming, and you should ask for help on some other stack exchange site (like unix or serverfault).

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!