Welcome Guest, Not a member yet? Register   Sign In
Problem autoloading helpers..
#1

[eluser]teamcoder[/eluser]
Hello everyone,

I am a newbie to PHP,well to coding in general but am picking it up pretty well, and thanks to some great informative sites out on the net things are going great, I have just one issue I cannot seem to resolve.

I am using XAMMP and everything is working as planned and am able to code everything and it is all working well except I cannot seem to get the helpers to help, i am getting

"Fatal error: Call to undefined function form_open() in C:\xampp\htdocs\codeigniter\system\application\views\newsletter.php on line 21"

I have set up the autoloader to load the form_helper and the url_helper but it does not seem to be loading it, I have even tried loading it the control file as such

This is my view file
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  

&lt;html&gt;  
  &lt;head&gt;  
    &lt;title&gt;News Letter&lt;/title&gt;  
    &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;  
  &lt;/head&gt;  
    
  &lt;body&gt;  

        
    <div id = "newsletter_form">
        
        &lt;?php echo form_open('email/send');?&gt;
        
        &lt;?php
        
        $name_data = array(
            'name' => 'name',
            'id' => 'name',
            'value' => set_value('name')
        );
        
        ?&gt;
        
        <p><label for="name">Name: </label>&lt;?php echo form_input($name_data); ?&gt;</p>
        
        <p>
            <label for='name'>Email Address:</label>
            &lt;input type='text' name='email' id-'email' value='&lt;?php echo set_value('email');?&gt;'&gt;
        </p>
        
        <p>&lt;?php echo form_submit('submit',"Submit");?&gt;</p>
        &lt;?php echo form_close(); ?&gt;
        
    </div>

  &lt;/body&gt;  
&lt;/html&gt;

And here is my controller file
Code:
&lt;?php

Class Email extends Controller
{
    function __construct()
    {
        parent::Controller();
    }
    
    function form()
    {
        $this->load->helper('form');
    }
    
    function index()
    {
        $this->load->view('newsletter');
    }
    
    function send()
    {
        
        $this->load->library('email');
        $this->email->set_newline("\r\n");
        
        $this->email->from('*********.com', '*****');
        $this->email->to('**********.com');
        $this->email->subject('This is an email test');
        $this->email->message('Its working yippie');
        
        $path= $this->config->item('server_root');
        $file = $path . '/codeigniter/attachment/yourinfo.txt';
        
        $this->email->attach($file);
        
        if($this->email->send()){
            echo 'Your email was sent';
        }
        else{
            show_error('$this->email->print_debugger()');
        }
    }
}
?&gt;


If anyone has any thoughts as to how I can set it up to work, I am running it on WindowsXP, codeigniter is setup in my htdocs folder and as I said other apps that I have written have all worked out great but everytime I try to use the form_helper I have the same issues.

PLEASE HELP ME!!!! :ahhh:


Messages In This Thread
Problem autoloading helpers.. - by El Forum - 11-15-2009, 11:59 AM
Problem autoloading helpers.. - by El Forum - 11-15-2009, 12:14 PM
Problem autoloading helpers.. - by El Forum - 11-15-2009, 01:20 PM
Problem autoloading helpers.. - by El Forum - 11-15-2009, 05:10 PM
Problem autoloading helpers.. - by El Forum - 11-15-2009, 06:31 PM
Problem autoloading helpers.. - by El Forum - 11-15-2009, 07:25 PM
Problem autoloading helpers.. - by El Forum - 11-15-2009, 10:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB