admin管理员组文章数量:1208155
When the form is submitted it keeps returning a GET method when I want a POST.
I dont understand where the problem is, any help would be much appreciated.
Code below:
Form in login.php:
<form action="includes/login.inc.php" method="post">
<button>Login</button>
</form>
includes/login.inc.php:
<?php
// This is printing - Request Method: GET
echo "Request Method: " . $_SERVER["REQUEST_METHOD"] . "<br>";
if ($_SERVER["REQUEST_METHOD"] === "POST") {
echo "Form submitted successfully";
} else {
// This is printing - Request Method: GET
echo "Request Method: " . $_SERVER["REQUEST_METHOD"] . "<br>";
}
本文标签: Form POST method responding as GET in php fileStack Overflow
版权声明:本文标题:Form POST method responding as GET in php file - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738751401a2110418.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论