Question: Need help with AJX PHP and Javascript. If the one dice win it should display a message of who won and if it's tie it
Need help with AJX PHP and Javascript. If the one dice win it should display a message of who won and if it's tie it should display a tie.



(1) Create a web page for the user to play dices against a server, as the screenshot below. (2) The title of the webpage is Dice; (3) Put your name on the page in Heading 1 text; (4) Place a button with caption "Play"; (5) Put two images below the button, both showing one-dot face initially. The image on the left is for user's dice, the other is for the server; (6) When the user clicks "Play" button, the webpage starts to calculate two random integers in the range of 1 and 6 inclusively to update dice images every 500 milliseconds; (7) At the same time, the webpage uses AJAX/AJAJ to get a random number from a PHP page; (8) The PHP page first sleeps for 5 seconds, and then calculates a random integer in the range of 1 and 6 inclusively and returns it; (9) On receipt of the message from the PHP page, the webpage stops the periodic timer started in step (6), and uses the random integer it received to update the image on the right
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
