-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
51 lines (40 loc) · 1.09 KB
/
index.php
File metadata and controls
51 lines (40 loc) · 1.09 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
43
44
45
46
47
48
49
<?php
ob_start();
require_once 'main_chars.php';
require_once 'functions/main.php';
require_once 'database/connection.php';
$base = new databasecon();
$base->connect();
$base->insert("SET NAMES utf8");
$template =
file_get_contents($_SERVER['DOCUMENT_ROOT']
.'/templates/main/index.html');
$template = replaceMain($template);
$logindata = "";
if ($_POST["submit"]){
ob_end_clean();
require_once 'functions/login.php';
}elseif($_POST["exit"]){
require_once 'functions/exit.php';
require_once 'functions/cleanEnter.php';
}else{
if ($_COOKIE["logindata"]){
require_once 'functions/loginedEnter.php';
}else{
require_once 'functions/cleanEnter.php';
}
}
if ($logindata==""){
if (empty($_GET["page"])){
require_once 'classes/main.php';
}elseif ($_GET["page"] == "news"){
require_once 'classes/news.php';
}
$data = new data();
echo $data->formPage($base, $template);
}else{
$template = str_replace('<!--%content%-->',
$logindata, $template);
echo $template;
}
$base->disconnect();