2013-02-20 25 views
0

我需要傳遞幾個GET變量。我需要這個鏈接是已經連接了另一個變量的GET方法

的index.php?類型=門&數量= 4

我可以寫這還不夠容易像

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

但我需要選擇弗朗下降了$數量金額下拉列表。所以,我有

<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> 

所以,我怎麼能在這兩個值追加到一個讓我得到那麼_GET $他們的下一個頁面,就像我會與我創建的第一個鏈接?

+1

嘗試使用數組或ü可以使用會話 – user2051349 2013-02-20 01:24:34

+1

' '。 – rlatief 2013-02-20 01:30:52

+0

使用javascript設置表單動作...嘗試一下。 – Chintan 2013-02-20 01:33:06

回答

1

如果qty需要是select,那麼將該名稱給select。另外,將另一個變量與一個隱藏的字段一起傳遞,這是非常標準的。祝你好運:)

<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> 
+0

啊完美!隱藏的形式完全滑落了我的心靈。太感謝了。 – 2013-02-20 01:34:23

相關問題