views:

19

answers:

1

Hi,

I'm trying to post some information from a from do so some calculations, however for some reason that data isn't posting. I do a var_dump after I get the info, and it still is blank. Any help would be great.

My Controller:

<?php
class Timevalueshow extends Controller{

function index(){       
    $this->load->view('Timevalueshow_view');
}

function submit(){

    $years = $this->input->post('years');
    $rate = $this->input->post('rate');
    $principle = $this->input->post('principle');
    $periods = $this->input->post('periods');
    $isCont = $this->input->post('continuous');

    var_dump($years);

    $params = array(
        'years' => $years, 
        'rate' => $rate, 
        'principle' => $principle, 
        'periods' => $periods, 
        'isCont' => $isCont
    );

    var_dump($params);
    $this->load->library('timevalue',$params);
    $this->timevalue->leprint();
}
}
?>

And the view file.

<head>
    <title>Time Value of Money</title>
</head>

<body>
    <div id="container">

        <form method="POST" action="http://localhost:8888/CodeIgniter_1.7.2/index.php/timevalueshow/submit"&gt;
            <p>Years: </p> <input id="years" type="text" />
            <p>Rate: </p> <input type="text" id="rate"/>
            <p>Principle: </p> <input type="text" id="principle"/>
            <p>Periods: </p> <input type="text" id="periods"/>
            <p>Continuous?: </p> <input type="checkbox" id="continuous"/>
            <input type="submit" value="Submit"/>
        </form>

    </div>
</body>

+2  A: 

You didn't submitted the form elements' name's only their id's. Edit your form so the elements contain name attributes too.

fabrik
Wow, I thought I tried that and it didn't work, but it did this time. Thanks so much.
tshauck