CodeIgniter Forums
$_POST and $this->input->post was empty after submit in production environment. why? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: $_POST and $this->input->post was empty after submit in production environment. why? (/showthread.php?tid=36204)



$_POST and $this->input->post was empty after submit in production environment. why? - El Forum - 11-25-2010

[eluser]Gian Marco[/eluser]
Hello, I have recently uploaded in production environment my site build with codeigniter.

My problem is: in local pc and in other servers all works ok, but on aruba hosting, a cheaper italian hosting, $_POST submission seems to don't work correctly.

I have build a test page:

http://www.immobiliarecipolli.it/sito_nuovo/index.php/admin/home/login

Here i print POST, GET, SESSION, and SERVER arrays.

then at the bottom of the page there is the form for make login.
In theory, if you insert somthing and click the login button, at the top of the page the post array should be valorized with passed username and password, but on this server nothing appen.

My php configuration is visible here:

http://www.immobiliarecipolli.it/sito_nuovo/prova.php


any ideas about what's the problem?

thank you


$_POST and $this->input->post was empty after submit in production environment. why? - El Forum - 11-25-2010

[eluser]nuwanda[/eluser]
Need more info?

What's the output from your post?


$_POST and $this->input->post was empty after submit in production environment. why? - El Forum - 11-25-2010

[eluser]Gian Marco[/eluser]
in my development environment, the the post array (after submit) should be something like:

POST
Array
(
[username] => pippo
[password] => pippo
[login] => Login
)

what can be the problem?

in production environment the post array is empty.

you can test it, using the form at the bottom of the page.

My site is in a subfolder, and I use rewrite rules


$_POST and $this->input->post was empty after submit in production environment. why? - El Forum - 11-25-2010

[eluser]tonanbarbarian[/eluser]
something wrong with your server setup or your ci setup
what i noticed was that the url you supplied was http://www.immobiliarecipolli.it/sito_nuovo/index.php/admin/home/login
however the form is submitting to http://immobiliarecipolli.it/sito_nuovo/index.php/admin/home/login
but after the submit the page url is still http://www.immobiliarecipolli.it/sito_nuovo/index.php/admin/home/login

so i suspect the form is submitting properly, but either the webserver, or codeigniter is redirecting from http://immobiliarecipolli.it/sito_nuovo/index.php/admin/home/login back to http://www.immobiliarecipolli.it/sito_nuovo/index.php/admin/home/login and thereby loosing the post data


$_POST and $this->input->post was empty after submit in production environment. why? - El Forum - 11-25-2010

[eluser]Gian Marco[/eluser]
SOLVED!!

the problem was that I set the

$config['base_url']

variable of config.php file to "http://immobiliarecipolli.it/sito_nuovo",
but the domain without www. doesn't exist.

i change it to "http://www.immobiliarecipolli.it/sito_nuovo",
and all work great!