0

how can I make interactive webpage with a radio buttons to be selected from "client side" and switch questions after clicking button in another webpage "admin side"

Client page

Option 1: <input type="radio" value="a">
Option 2: <input type="radio" value="b">

Admin Page

//something says question selected = "b" after client select an answer
<input type="button" value="next Question">

after pressing Next button in admin page it automatedly switch client page to another question

Client Page again after admin press Next button

Option 3: <input type="radio" value="c">
Option 4: <input type="radio" value="d">

Note: i saw this style in a website called mintimeter and the link for this feature here

  • May I ask why you want to admin to press a "next question" button? Would it not be easier if the client proceeds to the next question automatically? In this case the admin could still monitor the answers and progress of the client, but is not forced to press a button all the time. That would also be more similar to the feature "mintimeter" you refer to. It would even allow for more clients to go through the questions at the same time. – KIKO Software Mar 08 '21 at 10:07
  • i am making a kind of a game and their are 4 teams answering the question at the same time so i have to wait for all teams and discuss the answers before moving to the 2nd question for the 4 teams at the same time as well – David Raouf Mar 08 '21 at 10:11
  • To have this kind of proxy peer-to-peer system where client X controls the content in client Y, you would be best using something like websockets. This way client X sends the signal to the server to progress to the next question and the server then broadcasts a message to every other client subscribed to that socket (ie. all the other teams) whose clients then update the UI as necessary. – Rory McCrossan Mar 08 '21 at 10:14
  • Sounds like maybe you need Websockets or Server-Sent Events, so that the server can send messages to all (relevant) clients when a certain event occurs. – ADyson Mar 08 '21 at 10:14
  • OK, that explains it. I see you just got a few comments about Websockets and Server-Sent Events, that seems the way to go, and you should probably use a database in the background. – KIKO Software Mar 08 '21 at 10:15
  • @RoryMcCrossan thank you so much for the response and if i can ask do you have a link for a written example – David Raouf Mar 08 '21 at 10:16
  • I've only worked with websockets in C#/SignalR, so don't have anything PHP related. Hopefully [this question](https://stackoverflow.com/q/14512182/519413) is of some help to you though – Rory McCrossan Mar 08 '21 at 10:18
  • Maybe see also http://socketo.me/ - this is the website for Ratchet, a PHP implementation of a websocket server. – ADyson Mar 08 '21 at 10:26

0 Answers0