Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Call to undefined function form_open()
#1

[eluser]pigfox[/eluser]
In controller
function index()
{
.
.
$this->load->view('contact_form');
.
.
}

In /views/contact_form.php
<h3>Contact</h3>
&lt;? echo form_open('contact/send'); ?&gt;
&lt;? echo $name; ?&gt;:
&lt;? echo form_input('name'); ?&gt;
</br>
&lt;? echo $email; ?&gt;:
&lt;? echo form_input('email'); ?&gt;
</br>
&lt;? echo $message; ?&gt;:
&lt;? echo form_textarea('message'); ?&gt;
</br>
&lt;? echo form_submit('submit','Submit!'); ?&gt;
&lt;? echo form_close(); ?&gt;
Fatal error: Call to undefined function form_open() in /chroot/home/user/html/system/application/views/contact_form.php on line 2

Has anyone had this error before?
If so what is the problem?
#2

[eluser]Unknown[/eluser]
have you loaded the form helper using $this->load->helper('form'); ?
#3

[eluser]Christopher Blankenship[/eluser]
If you will be utilizing the Form Helper alot throughout your site, I suggest using the config/autoload.php to load it. This will skip the step of adding it everywhere there will be a form.
#4

[eluser]pigfox[/eluser]
After I did it works.
Thank you!




Theme © iAndrew 2016 - Forum software by © MyBB