PHP表单帖子总是空的 [英] PHP Form post always empty
问题描述
这一定是配置问题,我希望有人能够提供帮助。我在我的本地主机上建立了一个新项目,我的PHP帖子总是空的。以下是这个例子:
我的表单页面:
< form id =loginFormaction =/ post / loginmethod =post>
< input type =textname =username/>
< input type =passwordname =password/>
< input type =submitvalue =Submit/>
< / form>
和/post/login/index.php页面:
<?php
var_dump($ _POST);
?>
结果:
array(0){}
好像没有代码问题,问题是什么?
尝试这样做: this must be configuration issue and I'm hoping somebody can help. I'm setting up a new project on my localhost and my PHP Post is always empty. Here's the example: My Form Page: and the "/post/login/index.php" page: the result: It seems like there's no code issue so what's the problem? The Try doing this instead:
这篇关于PHP表单帖子总是空的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
< form id =loginFormaction =/ post / login / index.phpmethod =post>
<form id="loginForm" action="/post/login" method="post">
<input type="text" name="username" />
<input type="password" name="password" />
<input type="submit" value="Submit" />
</form>
<?php
var_dump( $_POST );
?>
array(0) { }
action
attribute needs to point to the actual script of the page you want to go to.<form id="loginForm" action="/post/login/index.php" method="post">