0

いくつかの GET 変数を渡す必要があります。私が必要とするリンクは

index.php?type=ドア&qty=4

私はこれを次のように簡単に書くことができます

<a href="index.php?type='.$type.'&qty='.$qty.'"></a>

しかし、ドロップダウン リストから $qty の金額を選択する必要があります。ので、私は持っています

<form name="qty" method="GET" action="../../../index.php?door-type="<?php echo $door_model; ?>">';
        <select>
<?php

    for ($front_int=1; $front_int<=99; $front_int++) 
    {
        echo'<option value="'.$front_int.'">'. $front_int . '</option>';
    }
?>
    </select>
<input type="submit" value="front-qty">
</form>

では、これら 2 つの値を 1 つに追加して、最初に作成したリンクの場合と同様に、次のページで $_GET を取得するにはどうすればよいでしょうか?

4

1 に答える 1

0

数量を選択する必要がある場合は、その名前を選択に付けます。また、かなり標準的な非表示フィールドを使用して他の変数を渡します。幸運を :)

<form name="NOT_QTY" method="GET" action="../../../index.php">
    <input type="hidden" name="door-type" value="<?php echo $door_model;?">
    <select name="qty">
<?php

    for ($front_int=1; $front_int<=99; $front_int++) 
    {
        echo'<option value="'.$front_int.'">'. $front_int . '</option>';
    }
?>
    </select>
<input type="submit" value="front-qty">
</form>
于 2013-02-20T01:31:01.910 に答える