Fatal error: function call undefined form_open () in c

I got this error and guessed, I know where I was wrong. I'm new to codeigniter, so I'm sure something stupid can anyone figure this out from tnx in advance.

create_view.php

<body> <?php echo form_open('create'); ?> <ul id="accordion"> <li> <a>Survey Creation</a> <ul id="survay"> <li>Enter a question:<?php echo form_input('Question')?></li> <li>Answer A: <?php echo form_input('qA' );?></li> <li>Answer B: <?php echo form_input('qB' );?></li> <li>Answer C: <?php echo form_input('qC' );?></li> <li><?php echo form_submit('submit', 'Set This Question' );?></li> </ul> </li> 

create.php

  <?php class Create extends CI_Controller{ function index(){ $this->load->view('create_view'); } // insert data function create1() { $data = array( 'Question' => $this->input->post('Question'), 'qA' => $this->input->post('qA'), 'qB' => $this->input->post('qB'), 'qC' => $this->input->post('qC'), ); $this->create_model->add_record($data); $this->home(); } } ?> 
+9
php codeigniter
source share
5 answers

It looks like you forgot to load the form helper . Use application/config/autoload.php or add the following line to the controller before loading the view:

 $this->load->helper('form'); 
+41
source share

You can also download these helpers on all controllers. Go to your configuration folder and open the autoload.php file in any editor, and then load the required assistant as follows:

 $autoload['helper'] = array('url','form'); 
+8
source share

Upload your CI helper to the controller $ This-> load-> helper ('form');

 class Create extends CI_Controller{ function index(){ $this->load->view('create_view'); $this->load->helper('form'); 

or make autoload assistants on all consoles. Open the application /config/autoload.php

  $autoload['helpers'] = array('form','myhelper'); 
+3
source share

Before using this function, you need to download the "Helper". Add this line:

 $this->load->helper('form'); 
0
source share

Make sure the following line is called in the controller:

 $this->load->library('form_validation'); //make sure to have it, before view call $this->load->view('profile'); 
0
source share

All Articles