codeigniter-2

Codeigniter Not Connecting to SQL Server

僤鯓⒐⒋嵵緔 提交于 2019-12-02 11:07:27
I'm trying to connect to an SQL server using CodeIgniter. If I use the sqlsrv driver - I get a fatal error message and if I use the odbc driver - I get an 'Unable to connect to your database server using the provided settings error message. Does anyone know how to fix this problem??? I don't mind how, I just want Codeigniter to connect to the SQL Server Database. This is the database config file $db['otherdb']['hostname'] = '195.234.10.55\SQLEXPRESS'; $db['otherdb']['username'] = 'username'; $db['otherdb']['password'] = 'password'; $db['otherdb']['database'] = 'ONEDB'; $db['otherdb']['dbdriver

CodeIgniter load controller within a controller HMVC

风流意气都作罢 提交于 2019-12-02 10:24:28
I'm using http://github.com/philsturgeon/codeigniter-template/ for the templates and I trying to load other controller view to actual view as a partial. My main problem is that I cant append meta data (javascripts, css) from other controller to the main controller. application/core/MY_Loader.php class MY_Loader extends CI_Loader { function __construct() { parent::__construct(); } function controller( $sController ) { global $RTR; // Parse the sController string ex: demo/index $aControllerData = explode( '/', $sController ); $sMethod = !empty( $aControllerData[1] ) ? $aControllerData[1] :

Undefined $load property error after upgrading CodeIgniter 1.7 to 2.1

烂漫一生 提交于 2019-12-02 09:22:32
Why I get this error after upgrading CodeIgniter from v1.7 to v2.1? A PHP Error was encountered Severity: Notice Message: Undefined property: Site::$load Filename: libraries/Website.php Line Number: 25 Fatal error: Call to a member function library() on a non-object in C:\xampp\htdocs\travel\application\libraries\Website.php on line 25 The library application/library/website class Website extends CI_Controller { public static $current_city; public function __construct() { $this->load->library('language'); // line 25 $this->language->loadLanguage(); $this->load_main_lang_file(); $this->load

Storing specific Date/Time values for users in different time zones

血红的双手。 提交于 2019-12-02 08:06:06
I'm working on a PHP(CodeIgniter)/MySQL application that allows users select when their blog post will be published. How I have designed it to work so far is as below: User sets the timezone in his/her profile. User sets the publish date of the blog post. This date/time is assumed to be based on user's timezone. Based on user's timezone, the publish date is converted to UTC (00:00). The converted date is stored as DATETIME in mysql. Server frequently converts the stored DATETIME values to server timezone and publishes the content when their time has come. I was wondering if there is a better

Not to load an autoload library in codeigniter

好久不见. 提交于 2019-12-02 07:45:50
I have a library which is used by all controllers. But for a specific controller i dont want to load that library. Is there any way i can stop loading that library for that controller. i am using this command but its failing: $this->load->library('xyz',array('autoload' => FALSE)); Thanks Autoloading is meant for site-global items. A cleaner solution may be to extend the controller and load the library in that new controller's constructor. Then all of your controllers extend from that controller, except the one(s) you don't want to load that library - those can extend the original CI controller

CodeIgniter and autoloading the database library

≡放荡痞女 提交于 2019-12-02 06:33:08
问题 I've got an issue connecting to the database with CodeIgniter. In the model, if I do $this->load->database(); then a query such as $query = $this->db->get('articles', 10); works and returns data. However, when I remove the load->database line and try autoloading the database library, using $autoload['libraries'] = array('database'); in application/config/autoload.php, the above query fails. As it works when I explicitly load the library, it's not a problem with my database connection. I'm

Codeigniter send mail using gmail is not working, just reloading

无人久伴 提交于 2019-12-02 04:33:13
I tried to send a email using gmail server with following configurations. $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com', 'smtp_port' => 465, 'smtp_user' => 'dinukathilanga@gmail.com', 'smtp_pass' => '2334444@', 'mailtype' => 'html', 'charset' => 'iso-8859-1', 'starttls' => true, ); $this->load->library('email', $config); $this->email->from('dinukathilanga@gmail.com', 'Dinuka Thilanga'); $this->email->to('bbelekkaya@gmail.com'); $this->email->subject('Email Test'); $this->email->message('Testing the email class.'); $this->email->send(); echo $this->email-

Codeigniter htaccess not working on godaddy?

落花浮王杯 提交于 2019-12-02 04:21:54
I recently moved to godaddy Linux hosting and the .htaccess doesn't seem to work. Are there any settings which need to be done for godaddy because the .htaccess was working on local xampp server as well as hostek server.I am getting "404 Not Found" error message.i am using CodeIgniter-2.2.1 framework also i have check mod_rewrite in Loaded Modules in php.ini file was not found enable from server side . My htaccess file located on root directory where my application is deployed. RewriteEngine On RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond

CodeIgniter Anchor error: URL not found on this server

狂风中的少年 提交于 2019-12-02 02:45:27
I have been for hours to make a simple anchor link working without success. My controller is class Welcome extends CI_Controller { public function index() { $this->load->view('template'); } public function contact() { $this->load->view('contact'); } } My template.php view is basically a file with <a class="menuhref"> <?php echo anchor('welcome/contact/','Contato')?> </a> I also have a contact.php in the views directory. My config.php is $config['base_url'] = 'localhost'; $config['index_page'] = 'index.php'; When the template.php loads and I click in the link "contato" I would like to drive the

codeigniter setting session variable with a variable not working

你离开我真会死。 提交于 2019-12-01 23:53:14
Using codeigniter running locally on WAMP and dealing with sessions. I tried the default session handler, db session, native session and now db session. They all result in the same issue and I can't for the life of me figure it out. The problem is that I am trying to set a session variable using a variable. I have confirmed the variable and have echoed it out and all is well in the controller. The controller calls on a view and the variable is there as well. The view calls on a uploader file and this is where the variable randomly gets set to "style.css" for some reason. If I set the session