0

Is there any way in PHP that if action X is performed then event Y should happen. Right now to track latest update, I am calling jquery Ajax at continuous time interval but I think, that is not a good way and put load on server.

Following I am trying to achieve

I want to implement one of my website page in many another websites so I just want, as soon as user clicks on "Add to cart", I can notify my customers that now you need to update cart count on your website.

I have gone through How to fire AJAX request Periodically? but did not understand it properly.

Any suggestion, is it feasible or does my question make sense? If yes what could be the possible solutions?

Community
  • 1
  • 1
Jass
  • 3,345
  • 3
  • 24
  • 41

1 Answers1

1

There is several ways for doing this:

Community
  • 1
  • 1
Yashar Aliabbasi
  • 2,663
  • 1
  • 23
  • 35
  • In this, I am not getting one thing. When status will be updated by me then how customer will know that status has been updated and now need to fire api call to get latest status. This is the main confusion – Jass May 18 '17 at 06:27
  • With using `socket.io` you have full duplex communication stack that your client and server can talk each other(by `json` data for example) – Yashar Aliabbasi May 18 '17 at 06:37