我在引导模式窗口中使用表单将数据发布到另一个页面。但是,当我尝试在另一页上打印帖子值时,我得到的只是一个空数组。
这是我的模态代码:
<div class="modal hide" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
X</button>
<h3 id="myModalLabel">
Enter your Credentials</h3>
</div>
<div class="modal-body">
<form id="modal-form" class="form-horizontal" accept-charset="UTF-8" method="POST" action="login.php" data-remote="true">
<div class="control-group">
<label class="control-label" for="inputEmail">Email</label>
<div class="controls">
<input type="email" id="email" placeholder="Email">
</div>
</div>
<div class="control-group">
<label class="control-label" for="inputPassword">Password</label>
<div class="controls">
<input type="password" id="passwd" placeholder="Password">
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox"> Remember me
</label>
<input type="submit" class="btn btn-primary" value="Submit"/>
<a href="register" class="btn btn-primary">Sign up</a>
</div>
</div>
</form>
</div>
</div>
这是我在 login.php 中给出的命令:
echo "Email is:";
echo $_POST["email"];
echo "Password is:";
echo $_POST["passwd"];
然而,我得到的只是一个空数组。
有什么特殊的方法我应该这样做吗?