Welcome Guest, Not a member yet? Register   Sign In
$_POST and $this->input->post was empty after submit in production environment. why?
#1

[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_nu...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
#2

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

What's the output from your post?
#3

[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
#4

[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_nu...home/login
however the form is submitting to http://immobiliarecipolli.it/sito_nuovo/...home/login
but after the submit the page url is still http://www.immobiliarecipolli.it/sito_nu...home/login

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

[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!




Theme © iAndrew 2016 - Forum software by © MyBB