Error in my email code |
[eluser]gibbo1715[/eluser]
HI all My first post here, introduced to codeigniter yesterday and i love it!!! can anyone spot my error in the code below please Im trying to sort an email script on my local server through google mail following jeffrey Way's video tutorial but still getting an error If i run an array on the controller page it works fine but if i try and have an email config file i get the error Undefined variable: config My code is as follows config/email.php Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); And my controller/email.php as follows Code: <?php Thanks for looking and any help you can offer Gibbo
[eluser]gibbo1715[/eluser]
All I have found if i put $config = ''; at the start of my function (see below) it works for me, this seems a bit weird to me to have to define my config as nothing to remove the error so if anyone has any other ideas as to whats going on let me know thanks gibbo Code: function index()
[eluser]überfuzz[/eluser]
Welcome to the forum. It's actually not so wierd that you have to define a variable before you use it. Question is, what you need it for if you set it to a blank string..? [quote author="gibbo1715" date="1260041076"]... Code: function index()
[eluser]gibbo1715[/eluser]
Thanks for the reply, having walked away and considered this it occured to me where my error might be $this->load->library('email', $config); i removed the $config and all errors gone as its declared in the email.php anyway opps thanks for looking Gibbo |
Welcome Guest, Not a member yet? Register Sign In |