Welcome Guest, Not a member yet? Register   Sign In
form post not working
#6

[eluser]brian-[/eluser]
I tried a "re-install" of codeigniter, and got the same results..So I have changed some of the tags.

Below is my view file.
Code:
<html>
<head>
<title>Order</title>
</head>
<body>

<?php foreach($query->result() as $row): ?>

Name
<br />
&lt;?=$row->revw_name?&gt;
<br />
Review
<br />
&lt;?=$row->revw_text?&gt;
&lt;?php endforeach; ?&gt;

<br />
&lt;?=form_open('order/process');?&gt;
Name
<br />
&lt;input type="text" name="revw_name" /&gt;
<br />
Review
<br />
&lt;textarea name="revw_text" rows="10"&gt;&lt;/textarea>
<br />
&lt;input type="submit" value="Submit" /&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

When I hit submit, it does go to the correct controller function since I did a simple echo command.

Here is the code of my controller file
Code:
class Order extends Controller {

    function Order()
    {
        parent::Controller();
        $this->load->helper('url');
        $this->load->helper('form');
    }
    
    function index()
    {
        $data['query'] = $this->db->get('Reviews');
        $this->load->view('order_process', $data);
    }
    
    function process()
    {    
        $revw_name = $this->input->post('revw_name');
$revw_text = $this->input->post('revw_text') ;

$this->db->set('revw_name', $revw_name); // DB_table_filed_name = respective DB table  filed name where value need to be store
$this->db->set('revw_text', $revw_text); //
$this->db->insert('Reviews');
        
        
}
}

And the post information placed into the database is 0 0. (I have two rows)


Messages In This Thread
form post not working - by El Forum - 09-02-2010, 02:10 PM
form post not working - by El Forum - 09-02-2010, 09:31 PM
form post not working - by El Forum - 09-02-2010, 10:01 PM
form post not working - by El Forum - 09-02-2010, 11:16 PM
form post not working - by El Forum - 09-02-2010, 11:26 PM
form post not working - by El Forum - 09-02-2010, 11:41 PM
form post not working - by El Forum - 09-02-2010, 11:48 PM
form post not working - by El Forum - 09-02-2010, 11:54 PM
form post not working - by El Forum - 09-03-2010, 12:09 AM
form post not working - by El Forum - 09-03-2010, 12:30 AM
form post not working - by El Forum - 09-03-2010, 12:36 AM
form post not working - by El Forum - 09-03-2010, 12:53 AM
form post not working - by El Forum - 09-03-2010, 12:57 AM
form post not working - by El Forum - 09-03-2010, 12:57 AM
form post not working - by El Forum - 09-03-2010, 01:05 AM
form post not working - by El Forum - 09-03-2010, 01:11 AM
form post not working - by El Forum - 09-03-2010, 01:19 AM
form post not working - by El Forum - 09-03-2010, 01:28 AM
form post not working - by El Forum - 09-03-2010, 03:10 AM
form post not working - by El Forum - 09-03-2010, 10:31 AM
form post not working - by El Forum - 09-06-2010, 12:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB