<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>Rock - Scissors - Paper</title>
    </head>

    <body>

        <?php
            
// Get the user's weapon from the form data
            
$user_weapon = (int) $_GET['user_weapon']; // 0 = Rock, 1 = Scissors, 2 = Paper
        
            // Get the computer's weapon (random number)
            
$computer_weapon rand(02); // 0 = Rock, 1 = Scissors, 2 = Paper
        
            // Compare them both and output the outcome
            
if ( $user_weapon == )
            {
                if ( 
$computer_weapon == )
                {
                    echo 
"<p>Computer's Rock ties with Player's Rock</p>";
                }
                if ( 
$computer_weapon == )
                {
                    echo 
"<p>Player's Rock beats Computer's Scissors</p>";
                }
                else
                {
                    echo 
"<p>Computer's Paper beats User's Rock</p>";
                }  
            }
            if ( 
$user_weapon == )
            {
                if ( 
$computer_weapon == )
                {
                    echo 
"<p>Computer's Rock beats Player's Scissors</p>";
                }
                if ( 
$computer_weapon == )
                {
                    echo 
"<p>Computer's Scissors ties with Player's Scissors</p>";
                }
                else 
                {
                    echo 
"<p>Player's Scissors beats Computer's Paper</p>";
                }  
            }
            else 
            {
                if (
$computer_weapon == )
                {
                    echo 
"<p>Player's Paper beats Computer's Rock</p>";
                }
                if ( 
$computer_weapon == )
                {
                    echo 
"<p>Computer's Scissors beats Player's Paper</p>";
                } 
                else
                {
                    echo 
"<p>Computer's Paper ties with Player's Paper</p>";
                }
            }
        
?>

    </body>

</html>