网站上的“实时订单"视图-需要建议! [英] 'Live orders' view on website - Advice needed!

查看:102
本文介绍了网站上的“实时订单"视图-需要建议!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是在接受一些建议-我正在建立一个在线商店(使用php/mysql),目前可以通过单击相关部分并应用过滤器等查看当前订单.还会发送电子邮件至我的收件箱.

I'm just after a bit of advice - I am building an online store (using php/mysql) and at present can view current orders by clicking through to the relevant section and applying filters etc. An email is also sent to my inbox.

由于业务的性质(需要在半小时内准备和发送订单),我想在我的网站上创建一个页面,该页面显示通过网站进入的实时"订单,我可以管理并在完成时标记出来.

Because of the nature of the business (orders need to be prepared and dispatched within half hour), I would like to have a page on my website that displays orders 'live' as they come through the website, that I can manage and mark off as they are fulfilled.

为此最好的方法是什么?

What would be the best approach to take for this??

推荐答案

使用 AJAX和彗星基于方法.

基本上,您有一个显示实时"订单的网页,该网页具有不断运行的AJAX查询,并访问一个有效轮询实时订单的PHP页面,然后休眠1至30秒(取决于您对响应的响应程度) ).您需要将最大执行时间设置为0,以使其永远不会结束.

Basically you have a Web page showing "live" orders that has an AJAX query constantly running and hitting a PHP page that effectively polls for live orders and then sleeps for 1-30 seconds (depending on how responsive you need it to be). You need to set the max execution time to 0 so it never ends.

该网页还必须检测它何时关闭(或用户移至另一页面)并杀死AJax请求,并在错误或超时时重新启动它.

The Webpage will also have to detect when it closes (or the user moves to another page) and kill the AJax request and also restart it if it errors or times out.

这篇关于网站上的“实时订单"视图-需要建议!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆