在我的 PHP 中,我有...
<?php
if(isset($_POST['username'])){
//do stuff
}
?>
它没有执行里面的内容,因为没有设置表单。这是我的 HTML ...(这是在 PHP 回显中,所以我设置了转义字符)
<form class=\"form-vertical\" action=\"./index.php\" method=\"post\">
<p>Enter username and password to continue.</p>
<div class=\"control-group\">
<div class=\"controls\">
<div class=\"input-prepend\">
<span class=\"add-on\"><i class=\"icon-user\"></i></span><input type=\"text\" name=\"username\" placeholder=\"Username\" />
</div>
</div>
</div>
<div class=\"control-group\">
<div class=\"controls\">
<div class=\"input-prepend\">
<span class=\"add-on\"><i class=\"icon-lock\"></i></span><input type=\"password\" name=\"password\" placeholder=\"Password\" />
</div>
</div>
</div>
<div class=\"form-actions\">
<span class=\"pull-left\"><a href=\"#\" class=\"flip-link\" id=\"to-recover\">Lost password?</a></span>
<span class=\"pull-left\" style=\"padding-left: 20px;\"><a href=\"\" class=\"flip-link\" id=\"to-register\">Register</a></span>
<span class=\"pull-right\"><input type=\"submit\" class=\"btn btn-inverse\" value=\"Login\" /></span>
</div>
</form>
在我的 URL 中,它使用 GET (index.php?username=blah&password=blah)