以下是我目前用于表单的代码:
<form method="post" action="access.php" class="form-stacked">
<fieldset class="control-group">
<div class="control-group">
<div class="controls">
<input class="input-xlarge" name="s1" id="s1" type="text" value="" />
</div>
</div>
<center>(click here if you need help finding your username)</center>
</fieldset>
<fieldset class="control-group">
<div class="control-group">
<div class="controls">
<input class="input-xlarge" name="s2" id="s2" type="text" value="" />
</div>
</div>
<center>(click here if you need help finding your username)</center>
</fieldset>
</form>
当我点击输入时,它会直接将人们带到http://mysite.com/access.php
但我试图找出如何将它们带到http://mysite.com/access.php?s1=value&s2=value
显然,该值将替换为实际输入的文本。对我来说,更改此代码以实现它的最简单方法是什么?
谢谢!
答案 0 :(得分:2)
请W3C阅读Architecture of the World Wide Web, Volume One和URIs, Addressability, and the use of HTTP GET and POST。
更改method="POST"
到
method="GET"
答案 1 :(得分:0)
从method="POST"
到method="GET"
多数民众赞成
答案 2 :(得分:0)
以下代码应该可以正常工作。但请注意,如果用户输入密码,信用卡信息等敏感数据,则不应执行此操作
<form method="get" action="access.php" class="form-stacked">
<fieldset class="control-group">
<div class="control-group">
<div class="controls">
<input class="input-xlarge" name="s1" id="s1" type="text" value="" />
</div>
</div>
<center>(click here if you need help finding your username)</center>
</fieldset>
<fieldset class="control-group">
<div class="control-group">
<div class="controls">
<input class="input-xlarge" name="s2" id="s2" type="text" value="" />
</div>
</div>
<center>(click here if you need help finding your username)</center>
</fieldset>