N
N
Nik_10112021-08-09 14:53:37
PHP
Nik_1011, 2021-08-09 14:53:37

How to save information about pressing a button on the server?

Hello. Tell me please.

Task: there is a landing page, the client has several employees, each has their own phone number and email address (they are scattered over feedback forms, whatsapp icons). Let's say Peter - 11 11 11; [email protected], Sergey - 22 22 22 [email protected], etc.

If visitor-1 went to the site and clicked on the whatsapp icon or the "call me back" button, then Peter's phone and email should change to Sergey for visitor-2, if visitor-1 went to the site and did nothing, the data should not change until visitor-1 or any other user clicks on the button.

How to implement it? As I understand it, you need to interact with the server and save information there, localstorage is only for one visitor, and not for everyone.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dollar, 2021-08-09
@dollar

As I understand it, you need to interact with the server and save information there

Yes . At the moment of clicking, send a request to the server and delay the reaction until a response from the server arrives. On the server, there will be the usual order: Petya, Vasya, Petya, Vasya, etc. Thus, whatever the pings, the order will be quite strict. And if it was not possible to reach the server, then something like Radnom (Petya, Vasya) can be used as a reaction.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question