[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">
<html>
<head>
<title>News Letter</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div id = "newsletter_form">
<?php echo form_open('email/send');?>
<?php
$name_data = array(
'name' => 'name',
'id' => 'name',
'value' => set_value('name')
);
?>
<p><label for="name">Name: </label><?php echo form_input($name_data); ?></p>
<p>
<label for='name'>Email Address:</label>
<input type='text' name='email' id-'email' value='<?php echo set_value('email');?>'>
</p>
<p><?php echo form_submit('submit',"Submit");?></p>
<?php echo form_close(); ?>
</div>
</body>
</html>
And here is my controller file
Code:
<?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()');
}
}
}
?>
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: