2013-02-20 32 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

相关问题