form post not working

#11
[eluser]brian-[/eluser]
Here is the form

Code:
<html>
<head>
<title>Order</title>
</head>
<body>


Name
<br />
0<br />
Review
<br />
0
Name
<br />
0<br />

Review
<br />
0
<br />
&lt;form action="http://example.com/index.php/order/process" method="post"&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;

And here is the page once you hit submit

Code:
<h1>$this->input->post()</h1><pre></pre><h1>$_POST</h1><pre>Array
(
)

#12
[eluser]mi6crazyheart[/eluser]
Hey brian-,
Set u'r base_url properly (available in config.php) & then execute once again...

#13
[eluser]basty_dread[/eluser]
this is what i do on the view
Code:
&lt;form action="yourcontroller" method="post"&gt;
&lt;input type="text" name="somename" /&gt;
&lt;input type="text" name="someother" /&gt;
&lt;input type="submit" value="Go" /&gt;
&lt;/form&gt;

#14
[eluser]brian-[/eluser]
sorry to confuse you, but I just put example.com so my url wouldn't show.

#15
[eluser]basty_dread[/eluser]
can you try this?

Code:
function adding_review(){
   $data['revw_name'] = $_POST['aname'];
   $data['revw_text'] = $_POST['info'];
   $this->db->insert('yourtablename',$data);
  }

#16
[eluser]brian-[/eluser]
I got the following error messages. Please view the screen shot.

#17
[eluser]basty_dread[/eluser]
i dont know if this is connected did load the form helper?
Code:
this->load->helper('form');

you might be missing up something..

#18
[eluser]brian-[/eluser]
This is what I have in the function Order()

$this->load->helper('form');

#19
[eluser]mi6crazyheart[/eluser]
ok , try this controller...

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()
    {    
        $this->load->helper(array('form', 'url'));

        $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');
        
        
}
}

#20
[eluser]brian-[/eluser]
Fatal error: Call to undefined function form_open()

Is the message that gets displayed. I did type the information in correctly.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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