A
A
Albert Kazan2018-02-14 21:09:42
PHP
Albert Kazan, 2018-02-14 21:09:42

How to connect multiple users?

PHP
The user interface seems to consist of several buttons that send data to some action. The server should accept this and "tell" immediately to other users what the first user clicked on.
In a group, let's say up to 5 people. These groups can be created in several pieces, these users can connect there. And communication occurs only between everyone within the group.
How to implement it? What to use?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex Plotnikov, 2018-02-14
@TrueDevs

in general websockets are needed.
socket.io to the client
to the server, for example https://github.com/reactphp/socket (by the way, I also installed nodejs and socket.io separately as a web socket server, so I'm not sure about the php library)

A
Artem Spiridonov, 2018-02-14
@customtema

How to implement it? What to use?

It is possible to try on PHP with any DB.
Create entity "Groups". (How to add records to a database table in PHP?)
Create a many-to-many "Group Users" sub-entity to add and remove users from groups. You will make selections on the same table - group users, whether the user is a member of the group, etc.
Create a "Group Comments" entity or something like that. Group members can add and read these messages.
Continue on this principle.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question