Welcome Guest, Not a member yet? Register   Sign In
$_POST and $this->input->post() are always empty on localhost site
#12

[eluser]ian[/eluser]
@InsiteFX,

Unfortunately, your suggestoin didn't work. Again, $this->form_validation->run() needs those email & password settings to be in that array to be able to validate the data in it.

@osci,

You're partially right. The code is posting to the same controller function that loads the view for the login page. You'll notice the very last line of the login() function loads the appropriate view.
Code:
$this->template->build('login', $this->data);
However, if the login credentials are correct, it creates a session for the user and redirects to the page they were on previously. However, if it can't do that (either because they're simply visiting the login page before trying to login or their login credentials can't be validated), they're shown the login page. So I don't think your suggestion to check that the login button is posted is necessary.

I uninstalled PHP 5.3 and installed PHP 5.2, but that doesn't seem to fix the problem, which I wasn't really expecting since I'm not using any special characters like the person in the forum post you provided.

Again, I posted the code because I was asked to, but I don't think the controller is the problem. It's possible that the view is giving me problems, since I use things like base_url(), but I haven't been able to find a definitive answer for why $_POST data is empty/null, except when caused by a redirect, which I'm not detecting.


Messages In This Thread
$_POST and $this->input->post() are always empty on localhost site - by El Forum - 06-21-2011, 08:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB