Welcome Guest, Not a member yet? Register   Sign In
Empty Post Variables
#1

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

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

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

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

[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.
#5

[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";
        }
    }
}
#6

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

[eluser]napz[/eluser]
Hi InsiteFX,

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

[eluser]napz[/eluser]
Hi,

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

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




Theme © iAndrew 2016 - Forum software by © MyBB