-2

i am doing url masking to pass the values. the code below input a variable.

 <form >
        <input type="text" name="name"  required />
        <button type="button" id="btn" action="drive/<?php echo$_GET['name'];?>
    /">submit</button>
    </form>

i want to pass the value like

 drive/12

but when i click the submit button it is passing like

 drive/?name=3.

what is the correct way of submitting the value?

4

2 回答 2

2

最简单的选择是将表单方法设置为 POST。

否则,您必须向表单的提交事件添加一个 javascript 处理程序,对文本字段进行编码并将浏览器重定向到所需的 url。

于 2013-07-18T06:14:11.457 回答
0

表单 URL 是您应该执行操作的位置,并且提交保持不变 - 现在默认情况下,NAME 作为表单的 get 传递。

 <form method="post" action="drive/<?php echo$_GET['name'];?">
        <input type="text" name="name"  required />
        <input type="submit" value="submit">
    </form>
于 2013-07-18T06:14:30.753 回答