I am trying to execute a PHP function when a HTML button is clicked, to change the text of a HTML label, but my code is not working.
Below is my code:
Can someone please tell me what I am doing wrong? Thanks a lot for any help.
     <form>
        <input type="number" name="score"><br>
        <input type="submit" name="Submit" class="btn btn-primary" action="calcScore">
    </form>
    function calcScore()
{
   $playerThrow = $_GET[$score];
   return $playerThrow;
}
<label class="scorePlate"><?php echo calcScore(player1) ?></label>
 
     
    