Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ob_start();
- session_start();
- //database credentials
- define('ROOT','/');
- define('DBHOST','localhost');
- define('DBUSER','root');
- define('DBPASS','root');
- define('DBNAME','blog');
- $db = new PDO("mysql:host=".DBHOST.";dbname=".DBNAME, DBUSER, DBPASS);
- $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- date_default_timezone_set('Europe/London');
- spl_autoload_register(function ($class) {
- $class = strtolower($class);
- $classpath = 'classes/class.'.$class . '.php';
- if ( file_exists($classpath)) {
- require_once $classpath;
- }
- $classpath = '../classes/class.'.$class . '.php';
- if ( file_exists($classpath)) {
- require_once $classpath;
- }
- $classpath = '../../classes/class.'.$class . '.php';
- if ( file_exists($classpath)) {
- require_once $classpath;
- }
- });
- $user = new User($db);
- error_reporting(E_ALL);
- ini_set('display_errors', 1);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement