Welcome Guest, Not a member yet? Register   Sign In
$_POST problem
#1

[eluser]lampard789[/eluser]
Hello,

I am new to CI. I have a problem with $_POST. In my view I created a form
Code:
<form action="<?=base_url()?>/portal/search/" method="post" >
<tr>
    <td align="right" colspan="2">
        &lt;input type="text" id="search" name="search" size="50" /&gt;
        &lt;input type="submit" name="submit" id="submit" value="Search" /&gt;
        <br /><br />
    </td>
</tr>
&lt;/form&gt;

And in my controller:
Code:
function search() {
    echo "POST vars: ".$_POST['search'];
    //... some other stuffs here
}

The result is an error as below:
Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined index: search

Filename: controllers/portal.php

Line Number: 92

I tried this in my local environment and it worked well. But when I uploaded it into my hosting, this error pops up. I'm wondering what is going wrong there.

Thanks!


Messages In This Thread
$_POST problem - by El Forum - 07-04-2008, 02:53 PM
$_POST problem - by El Forum - 07-04-2008, 04:18 PM
$_POST problem - by El Forum - 07-04-2008, 04:39 PM
$_POST problem - by El Forum - 07-04-2008, 07:06 PM
$_POST problem - by El Forum - 07-04-2008, 07:09 PM
$_POST problem - by El Forum - 07-04-2008, 08:27 PM
$_POST problem - by El Forum - 07-04-2008, 10:46 PM
$_POST problem - by El Forum - 07-05-2008, 12:38 AM
$_POST problem - by El Forum - 07-05-2008, 02:00 AM
$_POST problem - by El Forum - 07-05-2008, 07:25 AM
$_POST problem - by El Forum - 07-05-2008, 11:16 AM
$_POST problem - by El Forum - 07-05-2008, 04:22 PM
$_POST problem - by El Forum - 07-18-2008, 07:07 AM
$_POST problem - by El Forum - 07-18-2008, 11:32 AM
$_POST problem - by El Forum - 08-24-2008, 07:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB