-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
executable file
·77 lines (56 loc) · 1.78 KB
/
index.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
session_start();
$servername = "localhost";
$dbname= "social";
$username = "root";
$password = "";
function public_path($st){
return "http://localhost/social/Public/" . $st;
}
function url($st){
return "/social/" . $st;
}
function app_path($st){
return "App/" . $st;
}
function redirect($path,$key=-1,$value=-1){
if($key==-1){
header("Location: http://localhost/social/".$path);
}else{
header("Location: http://localhost/social/".$path."/".$key."/".$value);
}
exit();
}
function libirary($path){
return "lib/" . $path;
}
$conn="";
try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}catch(PDOException $e){
echo $e;
}
require_once(app_path('Core/functions.php'));
require_once(app_path('Core/App.php'));
require_once(app_path('Core/Controller.php'));
require_once(app_path('Core/DataBase.php'));
require_once(app_path('models/test_model.php'));
require_once(app_path('models/user_model.php'));
require_once(app_path('models/phone_model.php'));
require_once(app_path('models/post_model.php'));
require_once(app_path('models/friend_model.php'));
require_once(app_path('models/block_model.php'));
require_once(app_path('models/comment_model.php'));
// require_once(app_path('models/category_model.php'));
// require_once(app_path('models/course_model.php'));
// require_once(app_path('models/lesson_model.php'));
// require_once(app_path('models/quiz_model.php'));
// require_once(app_path('models/user_model.php'));
// require_once(app_path('models/assignment_model.php'));
// require_once(app_path('models/resourses_model.php'));
// require_once(app_path('models/messages_model.php'));
DataBase::$conn = $conn;
$app = new App();
//end