Reading form Data ($_POST or $_REQUEST)?

I'm new to CI... I got basic pages working per Derek's great video tutorials, but I'm having trouble processing a form. It's a basic search form where user types in a word, then I perform a SQL query fetching rows based on that word. However, I can't seem to read any data from the $_POST array... I've tried using both $_POST, $_REQUEST, and I've tried using CI's

My form looks like this:

<?php echo form_open('search/results'); ?>    
    <label for="searchterms">Search Terms: </label>
    &lt;input type="text" id="searchterms"&gt;
    &lt;input type="submit" value="Search"&gt;

And then my search.php's "results" function looks like this:

function results() {
        $searchterms = $this->input->post('searchterms');
        // $searchterms = $_POST['searchterms'];
        // $searchterms = $_REQUEST['searchterms'];

        echo "Search terms were:<br/>";        
        echo $searchterms;

Nothing ever makes it through, though... what am I missing?

your searchterms input needs a name attribute. -> name="searchterms"

Lol. Thanks.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.