N
N
nepster-web2014-01-20 05:37:31
PHP
nepster-web, 2014-01-20 05:37:31

How to show a message to the user?

The system is as follows:
I write a game portal, the user creates an application for the game, waits for rivals, clicks on the play button at this moment, I send data to the node.js server and send users to the server where the game is going (outside php).
Further, when the game is over, node.js sends a request to the php script, I process the users rating all things and answer node.js that yes, yes, everything is fine.
Now the task is this, node.js should redirect to the php page where I will show the result.
moment 1: the result url (site.ru/game/play/result/) must be clean, i.e. without get and post requests.
moment 2: you need to somehow show the data of the game played on it.
It doesn’t work with sessions, since sessions are different for each user, and when redirecting to this page, from 2 to 5 users fly away and each needs to show different data (data in the database).
Please tell me the idea of ​​how to show users the result on the screen in the current scenario?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Avery007, 2014-01-20
@nepster-web

Make a table in the database. There are fields in it: battle id (generated when entering the battle), then we shove it into the php session / enter it into another table in the field - "is in battle", the player's name, and then the data fields for each user. On the page with the results, we pull out the id from the session / database and the name of the player, and display the results based on them. If suddenly the id is empty (the person is not in combat), we display an error. As soon as all the players have looked at the results, we delete the data for the current battle, and clear the session or the "is in battle" field.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question