-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.php
executable file
·45 lines (35 loc) · 1.22 KB
/
main.php
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
43
44
45
<?php
session_start();
// autoload required core classes
function __autoload($class_name) {
switch ($class_name) {
case 'OpenGraphProtocol':
include_once 'core/ogp/open-graph-protocol.php';
break;
case 'PHPMailer':
include_once 'core/PHPMailer/PHPMailerAutoload.php';
break;
default:
include_once 'core/'.$class_name.'.php';
break;
}
}
define("debug",FALSE);
// root url constants
define("cdn","http".(!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] != "off"?"s":"")."://".$_SERVER["HTTP_HOST"]."/assets");
define("url_root","http".(!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] != "off"?"s":"")."://".$_SERVER["HTTP_HOST"]);
define("srv_root",$_SERVER['DOCUMENT_ROOT']);
$paths = new paths();
// language selection
define("lang",(isset($_COOKIE["lang"]) && $_COOKIE["lang"]!=""?$_COOKIE["lang"]:"fr"));
define("rtl",(lang=="ar"?TRUE:FALSE));
// connecting to database
include "db_config.php";
$db = mysqli_connect($db_server, $db_user, $db_password, $db_name) or die (mysqli_error);
$db->set_charset("utf8");
// check login
$user = (isset($_SESSION["user"]) ? unserialize($_SESSION["user"]) : null);
// var_dump(gf::search("aa bb"));
// routing url
include "router.php";
?>