-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.php
More file actions
42 lines (32 loc) · 1 KB
/
config.php
File metadata and controls
42 lines (32 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
ob_start();
session_start();
//database credentials
define('DBHOST','localhost');
define('DBUSER','root');
define('DBPASS','');
define('DBNAME','blog');
$db = new PDO("mysql:host=".DBHOST.";dbname=".DBNAME, DBUSER, DBPASS);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
require_once '../classes/class.user.php';
//load classes as needed
// function __autoload($class) {
// $class = strtolower($class);
// //if call from within assets adjust the path
// $classpath = 'classes/class.'.$class . '.php';
// if ( file_exists($classpath)) {
// require_once $classpath;
// }
// //if call from within admin adjust the path
// $classpath = '../classes/class.'.$class . '.php';
// if ( file_exists($classpath)) {
// require_once $classpath;
// }
// //if call from within admin adjust the path
// $classpath = '../../classes/class.'.$class . '.php';
// if ( file_exists($classpath)) {
// require_once $classpath;
// }
//}
$user = new User($db);
?>