CodeIgniter Forums
Empty Post Variables - 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: Empty Post Variables (/showthread.php?tid=3146)



Empty Post Variables - El Forum - 09-12-2007

[eluser]herbageonion[/eluser]
Hi, I'm getting empty post variables when I use:
Code:
$this->input->post('variable')
and I haven't a clue why, has anyone else come across this before?

Cheers,
- E


Empty Post Variables - El Forum - 09-12-2007

[eluser]coolfactor[/eluser]
Please provide details about your <form> fields. Do you have one with "variable" as the name?


Empty Post Variables - El Forum - 09-12-2007

[eluser]Michael Wales[/eluser]
Please paste your form code.

Please add print_r($_POST) to your post processing controller and paste that in here.


Empty Post Variables - El Forum - 09-13-2007

[eluser]herbageonion[/eluser]
Hi, thanks for replying, I figured out the problem, just some silly mistakes in the controller, lots of code in it so I missed a few things. I better start abstracting it properly before this happens again. Cheers.


Empty Post Variables - El Forum - 03-08-2011

[eluser]napz[/eluser]
Hi, Guys

I'm having problem too... it seems I have a blank output whenever I post the form. I already tried print_r($_POST) but still it doesn't have a value.

this is my view code
Code:
<form action="process" method="post">
        <table>
            
            <tr><td>Name </td></tr> <tr><td> &lt;input type="text" name="xxx" &gt;&lt;/td></tr>
            <tr><td> Description</td></tr> <tr><td>&lt;textarea name="department_desc"&gt;&lt;/textarea></td></tr>
            <tr><td colspan="2"> &lt;input type="submit" value="submit"&gt; </td></tr>
            
        </table>
    &lt;/form&gt;

this is my controller code
Code:
class Process extends BC1_Controller{   //WHERE IN BC1_CONTROLLER extends the CI_controller

    function __construct()
    {
        parent::__construct();
        
    }

    function index()
    {
        if($this->input->post('xxx')){
            echo "SUCCESS";
        }else{
            echo "FAILED";
        }
    }
}



Empty Post Variables - El Forum - 03-08-2011

[eluser]InsiteFX[/eluser]
If you are not using the Form_Validation library and form_helper, you need to specify the full url in the action!

Google search form post

InsiteFX


Empty Post Variables - El Forum - 03-08-2011

[eluser]napz[/eluser]
Hi InsiteFX,

yes, I already tried full URL for the action attribute of the form but still the problem persist.


Empty Post Variables - El Forum - 03-08-2011

[eluser]napz[/eluser]
Hi,

I already see the problem, it is in the htaccess. Smile


Empty Post Variables - El Forum - 06-16-2011

[eluser]ian[/eluser]
I'm having a similar problem, and I suspect my culprit is also my .htaccess. Can you tell us what you had to change in your .htaccess to get it to work?