I have select tag and I want if I choose one of the option, i want to go to different page my code doesnt work. Can somebody help me
<div id="paymentmethod" style="margin-bottom:50px;">
  <h4 style="font-weight: bold; color: #0C7D53;">Payment Method </h4>
  <form action="" method="post">
    <label style="padding-top:8px;">Choose your paymet method:</label>
    <select id="payment" class="form-control">
      <option value="cash">Cash</option>
      <option value="paypal">PayPal</option>
    </select>
    <p><br/></p>
    <center><input style="width:25%;" type="submit" name="submit" value="Checkout" class="btn btn-primary btn-lg"> </center>
  </form>
  <p><br/></p>
    <?php
    if(isset($_POST["paymentmethod"])){
        $payment = $_POST["payment"];
        if ($payment == "cash") {
            header("Location:http://localhost/Ecommerce-app-h/congrats.php");
            exit();
        } else {
            header("location:cart.php");
        }
    }
    ?>
</div>
 
     
     
    