简体   繁体   English

异步PHP请求(不是AJAX)

[英]Asynchronous PHP request (not AJAX)

I am developing an eshop application. 我正在开发一个eshop应用程序。 I am using webservice to create Order in Oracle database and websvc will give a response (OrderNumber) and I will inform customer that his Order (OrderNumber) is generated My problem The creation of order is taking too much time in backend system and user is keeping refreshing the page, On each refresh user is coming back to Order create Page, so user is able to click on create Order button again In such cases multiple orders are creating for same orderlines.I can restrict user to create only one order per session in case I got order number in websvc response and I can give ordernumber to customer in next page But real problem come when I didn't get response(Ordernumber) and user is refreshing page. 我正在使用Web服务在Oracle数据库中创建Order,并且websvc将给出响应(OrderNumber),并且我将通知客户已生成他的Order(OrderNumber)。我的问题订单的创建在后端系统中花费了太多时间,并且用户一直在使用刷新页面,在每次刷新时,用户将返回到“订单创建页面”,因此用户可以再次单击“创建订单”按钮。在这种情况下,将为同一订单行创建多个订单。我可以限制用户在每个会话中仅创建一个订单情况下,我在websvc响应中获得了订单号,可以在下一页中将订单号提供给客户,但是当我没有得到响应(订单号)并且用户正在刷新页面时,真正的问题就来了。 request is already went to Backend system and it will create order and my applicaion will not get response 请求已经转到后端系统,它将创建订单,我的应用程序将无法获得响应

Is there any method in PHP where we can asyncronously check the status of order if first request is initiated by user and it doesn't matter the furthur page navigation Please help me out.. Thanks in advance PHP中是否有任何方法可以让我们异步检查订单状态(如果第一个请求是由用户发起的,那么进一步的页面导航无关紧要,请帮助我。)

What you can do here is put a flag in the database for the submit information from the user (for eg user-ip-info, submit-status). 您在此处可以做的是在数据库中放置一个标志,用于记录来自用户的提交信息(例如,user-ip-info,submit-status)。 On load of the page, you can put a check for this flag and depending on it enable/disable the Create Order button. 在页面加载时,您可以检查该标志,并根据它启用/禁用“创建订单”按钮。

Let me know if you need more details. 让我知道您是否需要更多详细信息。

pinaki 皮纳基

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM