Undefined Variable: Config |
[eluser]Watermark Studios[/eluser]
Okay, so I am running through the video tutorials in the Wiki and I am finishing up the email tutorial. This is the error I'm getting right now: Quote:A PHP Error was encountered I moved my configuration information to a file called email.php in the config folder. That file looks like: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Keep in mind that I have to use the sendmail protocol because HostMonster doesn't support the smtp protocol. When I had the $config array defined in my email.php controller, everything worked fine. Now that I have the $config array defined in a config folder file it still works, but I get the error at the top of the page. Below is my code from my email.php in the controller folder: Code: <?php Attached is a JPG of my filesystem setup. I understand that technically $config is not defined in the controller, but it is through the email.php file in the config folder. Please help Ken
[eluser]n0xie[/eluser]
When setting up a email config file you do not need to load it manually: Quote:http://ellislab.com/codeigniter/user-gui...email.html This should work just fine: Code: $this->load->library('email');
[eluser]Watermark Studios[/eluser]
I was passing the $config array in the load statement: Code: $this->load->library('email', $config); But $config isn't defined until email is loaded. I changed it to: Code: $this->load->library('email'); and it worked just fine. Thanks! |
Welcome Guest, Not a member yet? Register Sign In |