Welcome Guest, Not a member yet? Register   Sign In
Empty POST Information
#1

[eluser]IanMcQ[/eluser]
Hi everybody,

For whatever reason, $_POST and $this->input->post('my_var'); are all empty in my CodeIgniter application whenever submitting a POST request.

I wrote a test script outside of CodeIgniter (below) to ensure that it wasn't improper server/PHP configuration. The script below worked. I am running other non-CI apps on the web server and they are having no $_POST issues.

Code:
<?php

if (isset($_POST['do_post']))
{
echo 'submit button was clicked';
}

?>

<form action="post_test.php" method="post">
<input type="hidden" name="do_post" value="1">
<input type="submit" name="submit_button" value="Submit Post Request">
</form>

Within my CI script, I've put:

Code:
//var_dump($_POST);
  //var_dump($this->input->post());
  //echo file_get_contents("php://input");

inside the app. $_POST is empty and $this->input->post() returns FALSE, but php://input returns the POST'ed information.

Any ideas of what might be causing this? Thanks in advanced. I'm stumped.
#2

[eluser]jairoh_[/eluser]
Code:
<form acti method="post">

specify the action=""
#3

[eluser]Pert[/eluser]
Try
Code:
$this->input->post('do_post')
#4

[eluser]IanMcQ[/eluser]
@jairoh_ sorry, that was a typo. The action="" is specified.

@Pert that doesn't work. That's the problem I am trying to solve.
#5

[eluser]Pert[/eluser]
What if you set <b>$config['global_xss_filtering'] = TRUE;</b> to false in your configuration file?

It sounds like a server problem, just because I haven't noticed CI clearing out _POST variable. Or maybe you have accidental $_POST = array() in your code somewhere?




Theme © iAndrew 2016 - Forum software by © MyBB