I have a strange problem with getting POST variables. I'm using bootstrap 3.2, here is my form :
<div class="col-sm-6" style="margin-left: 25%;">
<form role="form" action="/home/sign-in" method="post">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
<button type="submit" class="btn btn-default">Sign in</button>
</form>
</div>
And the action :
public function signinAction()
{
var_dump($_POST);
var_dump($this->request->getPost());
exit;
if (!$this->request->isPost()) {
return $this->response->redirect('/');
}
$usersModel = new Users();
if (($usersModel->getEmail() == $this->request->getPost('email')) &&
($usersModel->getPassword() == $this->request()->getPost('password'))
) {
$this->session->set(array('signin' => true));
return $this->response->redirect('/admin/dashboard');
}
$this->flashSession->error('Email/Password are wrong, please try again!');
}
When I'm dumping the POST variable there is nothing inside :
array (size=0)
empty
array (size=0)
empty