What common mistake was made in the PHP code for the calculator?

The common mistake in the PHP code for the calculator is that the form input values were not being properly retrieved using the `$_POST` superglobal. To solve this issue, we need to update the PHP code to retrieve the values of the `num1` and `num2` input fields from the form using `$_POST['num1']` and `$_POST['num2']` respectively.

<?php
if(isset($_POST['submit'])){
    $num1 = $_POST['num1'];
    $num2 = $_POST['num2'];
    
    $operator = $_POST['operator'];
    
    switch($operator){
        case '+':
            $result = $num1 + $num2;
            break;
        case '-':
            $result = $num1 - $num2;
            break;
        case '*':
            $result = $num1 * $num2;
            break;
        case '/':
            if($num2 != 0){
                $result = $num1 / $num2;
            } else {
                $result = "Cannot divide by zero";
            }
            break;
        default:
            $result = "Invalid operator";
    }
    
    echo "Result: $result";
}
?>

<form method="post">
    <input type="text" name="num1" placeholder="Enter first number">
    <select name="operator">
        <option value="+">+</option>
        <option value="-">-</option>
        <option value="*">*</option>
        <option value="/">/</option>
    </select>
    <input type="text" name="num2" placeholder="Enter second number">
    <input type="submit" name="submit" value="Calculate">
</form>