Welcome Guest, Not a member yet? Register   Sign In
CI Killing the $_POST variable
#1

[eluser]adamfairholm[/eluser]
This one has me scratching my head. I've got a form that is using post to submit some data. Really simple form, just a text field. However, when I submit, nothing happens - just a page refresh.

A quick print_r of the $_POST variable tells me that its not getting anything. It's just an empty array. Same with using the $this->input->post() function.

However, if I make a test.php file outside of the CI structure and do a quick $_POST test, it works as expected.

The CI exclusivity makes me think its not a server config issue, but something to do with CI. Has anyone ever run into this before? I haven't so I'm drawing a blank on where to even start.

Here is the code below. Like I said, it's very simple.

Controller:

Code:
function index()
    {
        print_r($_POST);
    
        if( isset($_POST) && ! empty($_POST) )
        {
                    //Do some stuff here
        }
    
        $this->load->view('placeholder', $this->data);
    }

View:

Code:
<form action="<?=$link_url;?>main" method="post">
                    
                    <p>&lt;input type="text" name="email_address" /&gt; &lt;input type="submit" name="Submit" id="submit_button" /&gt;&lt;/p>
                &lt;/form&gt;


Messages In This Thread
CI Killing the $_POST variable - by El Forum - 12-16-2009, 03:50 PM
CI Killing the $_POST variable - by El Forum - 12-17-2009, 09:03 PM
CI Killing the $_POST variable - by El Forum - 12-18-2009, 01:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB