i am doing a project in codeigniter, all the pages are done using mvc, the codeigniter framework. i have done a few pages in plain php and kept it in the root file. like the following pages: library.php database_connection.php
the index page is done using the framework, and i tried including the library.php file as below:
<?php
// Start Session
session_start();
// Application library ( with ShopingCart class )
require __DIR__ . 'library.php'
$app = new ShopingCart();
$products = $app->getProducts();
?>
at the top of the index page.
library.php starts like below:
<?php
// load database connection script
include("database_connection.php");
/*
* Tutorial: PHP MySQL Shopping cart
*
* Page: Application library
* */
class ShopingCart
{
protected $db;
function __construct()
{
$this->db = DB();
}
now the problem is when i am loading the index page, its not even loading showing the following error:
This page isn’t working localhost is currently unable to handle this request. HTTP ERROR 500
i think its because i am trying to include the file in the page, how can i get rid of this ?
</div>