3

if条件でページをリダイレクトしたい。

これは私のHTMLページです

<form name="frmpayment" enctype="application/x-www-form-urlencoded" action="payment_mode.php" method="POST">
    <table>
    <tr>
    <td><label for="mode">Select Mode</label></td>
    <td>
   <select name="selectmode" id="slctmode" size="1">
   <option selected>Selected Mode</option>
   <option value="1">Online Payment</option>
   <option value="2">Cash on Delevery</option>
    </select></td></tr>
    <tr><td></td><td>
    <input type="submit" name="btnmode" value="Done"/> 
         </td></tr></table>

    </form>

これが私の payment_mode.php ページです

<?php
$i= $_POST['selectmode'];

if($i>1)
    {
        header("Location : detail.php");

    }
else
    {
        header("Location : home.php");

    }

?>

btページのdetail.phpとhome.phpをリダイレクトしません

4

1 に答える 1