简体   繁体   中英

Asynchronous PHP request (not AJAX)

I am developing an eshop application. 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. 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

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). 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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