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

[eluser]ian[/eluser]
@toopay,

Thanks again for all your suggestions. I've pretty much ruled out the fact that a redirect is happening. I did discover something odd today. I can actually access the values I need trough $_REQUEST, e.g. $_REQUEST['email'] gives me my value. Yet, $_POST is still NULL. I always thought $_REQUEST was a combination of $_GET and $_POST while still enabling you to use $_GET and $_POST. So why can I access values from $_REQUEST but not $_POST? Any more ideas?
#22

[eluser]kjanko[/eluser]
Confirming, $_POST empty on my site. $_GET data passes fine.
#23

[eluser]Crackz0r[/eluser]
As someone said, it should not be about your code, since in online enviroment it works fine... So, its a localhost problem... and here is it:

You are running MAMP, you have to set your rewrite_module on in Apache Config... Im sure its the problem... as well as it is for Windows users using WAMP... i wasted 1.5hours of my time looking for a solution... OMG, i almost quit from CodeIgniter since, using $_post in non CI app this works fine, however, using the index.php and deleting the htaccess it worked fine, so, the problem was in the rewrite mod...

Hope this help you... Regards.
#24

[eluser]charlie spider[/eluser]
I'm having the exact same problem.

ZERO $_POST data on localhost even if I check at the top of index.php

The EXACT same code works on multiple live sites (downloaded from one just to check).

Interestingly enuf, I just switched to a new computer and thought I would try WAMPserver instead of XAMPP and was not experiencing this problem b4 (although it has been a while since I checked).

My WAMP install is running :

MySQL Server version: 5.5.16
Apache/2.2.21 (Win64)
MySQL client version: mysqlnd 5.0.8

and yes mod_rewrite is on.

Any simularities ian ?
#25

[eluser]Chathuranga Tennakoon[/eluser]
you have not specified the HTTP method in the form_open function.


Code:
>

<?php echo form_open('users/login', array('id'=>'login')); ?>


just try to add the POST method to form_open function as follows
Code:
>

<?php echo form_open('users/login', array('id'=>'login','method'=>'post')); ?>
#26

[eluser]Crackz0r[/eluser]
[quote author="Chathuranga Tennakoon" date="1330946373"]you have not specified the HTTP method in the form_open function.


Code:
>

<?php echo form_open('users/login', array('id'=>'login')); ?>


just try to add the POST method to form_open function as follows
Code:
>

<?php echo form_open('users/login', array('id'=>'login','method'=>'post')); ?>
[/quote]

Well actually by default CodeIgniter sets the method to POST when you dont specify any method as parameter... Now... i think its about mod_rewrite (rewrite_module in wampserver)... and ofc... keep in mind what InsiteFX said about configuration -> $config['uri_protocol'] = "REQUEST_URI"; in the other hand... check your htaccess file maybe something is wrong... here is mine:

Code:
<IfModule mod_rewrite.c>
    Options     +FollowSymLinks
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>

Try this out and let us know.

Regards




Theme © iAndrew 2016 - Forum software by © MyBB