-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
40 lines (32 loc) · 941 Bytes
/
index.php
File metadata and controls
40 lines (32 loc) · 941 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
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Simple-AcID index file.
*
* @author Jan Myler <info@janmyler.com>
* @copyright Copyright 2012, Jan Myler (http://janmyler.com)
*
*/
require_once(".config.php");
require_once("core/web.php");
// start the session
session_start();
// get path params
$path["page"] = (isset($_GET["page"])) ? $_GET["page"] : "";
$path["param1"] = (isset($_GET["param1"])) ? $_GET["param1"] : "";
$path["param2"] = (isset($_GET["param2"])) ? $_GET["param2"] : "";
$path["param3"] = (isset($_GET["param3"])) ? $_GET["param3"] : "";
// create new web object
$web = Web::getInstance();
$web->setPath($path);
// set requested website language
if (isset($_GET["lang"]) && array_key_exists($_GET["lang"], $langs)) {
$web->setLang($_GET["lang"]);
}
// check for error code
$err = (isset($_GET["err"])) ? $_GET["err"] : "" ;
$web->setError($err);
if (!$web->pageExists()) {
$web->setError('404');
}
// display web
echo $web->render();