CodeIgniter Forums
Post data empty - 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: Post data empty (/showthread.php?tid=55244)



Post data empty - El Forum - 10-16-2012

[eluser]ColBatGuano[/eluser]
All of my post data is empty.

I used a test controller (that I saw here somewhere)....

Code:
<?php
class Test extends CI_Controller {

  function Test()
  {
  parent::__construct();
  }
  
  function index()
  {
    echo ("<FORM action='".site_url()."/test/res' method='post'>
           <INPUT type='TEXT' name='testp'><input type='submit'></FORM>");
  }
  
  function res()
  {
    print_r($_POST);
  }
}
?>

and I get the output...

Code:
Array ( )

Running MAMP. I've also used

Code:
$this->output->enable_profiler(TRUE);

and this confirms that "No POST data exists". I don't know how to even go about debugging this! :-(


Any ideas?

thanks



Post data empty - El Forum - 10-16-2012

[eluser]skunkbad[/eluser]
Code:
echo '
  <form method="post" action="' . site_url('test/res') . '">
    <input type="text" name="yomamma" value="whatever" />
    <input type="submit" value="Submit" />
  </form>
';

By the way, this belongs in a view.


Post data empty - El Forum - 10-16-2012

[eluser]ColBatGuano[/eluser]
[quote author="skunkbad" date="1350454653"]
Code:
echo '
  <form method="post" action="' . site_url('test/res') . '">
    <input type="text" name="yomamma" value="whatever" />
    <input type="submit" value="Submit" />
  </form>
';

By the way, this belongs in a view.[/quote]

Hi Skunkbad,

Yep, I know it should be. This was the smallest example I could come up with that shows the problem.


Post data empty - El Forum - 10-16-2012

[eluser]skunkbad[/eluser]
Is it working now?


Post data empty - El Forum - 10-17-2012

[eluser]ColBatGuano[/eluser]
Same problem I'm afraid. I've got another controller & view...

Code:
<form action="/company/delete_confirmed" method="POST">
Are you sure you want to delete this record?
<input type="text" name="ID" value="1"  /><input type="text" name="name" value="dale"  /><input type="submit" name="mysubmit" value="OK"  />

</form>

The controller for this still shows 'no post values'.