-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsettings.php
More file actions
27 lines (24 loc) · 852 Bytes
/
settings.php
File metadata and controls
27 lines (24 loc) · 852 Bytes
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
<?php
//database connect
define ('DB_USER', 'hsproduc_cms');
define ('DB_PASSWORD', 'cms');
define ('DB_HOST', 'localhost');
define ('DB_NAME', 'hsproduc_cms');
try
{
$dbh = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME, DB_USER, DB_PASSWORD);
$dbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
}
catch(PDOException $e)
{
echo $e->getMessage();
die();
}
//website settings
define('CMS_DIR', dirname(__FILE__)); //simple-cms absolute path
define('WEBSITE_DIR', dirname(CMS_DIR)); //simple-cms parent absolute path
define('ROOT_URL', 'http://'. $_SERVER['HTTP_HOST']);
define('CMS_URL', 'http://'. $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']));
//remove trailing '/'
define('WEBSITE_URL', 'http://'. preg_replace( '/\/$/', '', $_SERVER['HTTP_HOST'] . dirname(dirname(dirname($_SERVER['PHP_SELF'])))) );
?>