CodeIgniter Forums

Full Version: POST problems
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]kaosweaver[/eluser]
I'm confused beyond belief. I don't know why this doesn't work:

http://www.ruralbounty.com/adsamples/test

Top form doesn't work (done in CI)

copy of top form next on the page does (done in the sandbox outside of CI)

Both go to the same center content and should have the POST contents displayed.

The (relevant lines from the) CI controller:

Code:
function test2()
    {
        $data['statez']=$this->input->post('statez');
        $this->load->view("defaultTwoColumn",$data);
    }

Code to show the post:

Code:
<?
echo '<ul>';
foreach ($_POST as $key=>$value)
{
    echo "<li>$key = $value</li>";
}
echo '</ul>';
?&gt;

Code to get the value in the page:

Code:
&lt;?=$statez;?&gt;

The rest of the posts on the site work. Obviously I'm missing something, would appreciate some help.

El Forum

[eluser]Sean Gates[/eluser]
I'm not sure why you loop the $_POST array, because you should be able to use the $statez variable just fine without it.

So, defaultTwoColumn is the view that has this in it?:

Code:
&lt;?=$statez;?&gt;