我和我的同事在一天中使用下面的链接几次,点击几个页面,最终得到这个链接:http://eharita.mamak.bel.tr/imararsiv/test.aspx?f_ada=36391&f_parsel=4
我想做的是,在test.aspx?_ada=之后,你看到36391,这是我的第一个数字,&f_parsel= 4,这是第二个数字。
我想要创建一个由两个框和一个提交、发送按钮组成的HTML,在第一个框中,我要写下一个数字(在示例中是: 36391),在第二个框中,另一个数字(在示例中是: 4),然后单击submit或Send按钮,这个操作将带我到http://eharita.mamak.bel.tr/imararsiv/test.aspx?f_ada=36391&f_parsel=4的URL。
也许这很简单,但作为一个土木工程师,我不知道如何制作这样的HTML页面。
发布于 2015-10-28 11:26:11
这很容易,你只需要一个基本的形式。
<form action="http://eharita.mamak.bel.tr/imararsiv/test.aspx" method="GET">
<input type="text" name="f_ada" > <br>
<input type="text" name="f_parsel"> <br>
<button type="submit"> Submit</button>
</form>你可以在这里试试,http://jsfiddle.net/ea6heach/
发布于 2015-10-28 11:28:55
<form action="http://eharita.mamak.bel.tr/imararsiv/test.aspx">
<input type="text" name="f_ada"/><br>
<input type="text" name="f_parcel"/><br>
<input type="submit" name="submit"/>
</form>
演示不起作用,因为Stackoverflow不允许HTML重定向,但这是一个简单表单的想法。
发布于 2015-10-28 11:30:40
下面的表单在特定的html文件中写入。
<form action="action_page.php">
First number<br>
<input type="text" name="first_val" >
<br>
Second number<br>
<input type="text" name="second_val">
<br><br>
<input type="submit" value="Submit">
</form>//在'action_page.php‘文件中写入以下代码。
<?php
//in the action_page.php file write following code
if(isset($_GET['first_val']) && isset($_GET['second_val'])
{
?f_ada=36391&f_parsel=4
$url = 'http://eharita.mamak.bel.tr/imararsiv/test.aspx/';
$url .= '?f_ada='.$_GET['first_val']&f_parsel['second_val'];
header('Location: $url);
}
?>https://stackoverflow.com/questions/33389630
复制相似问题