-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
24 lines (17 loc) · 855 Bytes
/
index.php
File metadata and controls
24 lines (17 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
session_start();
require_once 'lib/config.php';
require_once 'lib/functions.php';
if(!loggedIn() && !isset($_SESSION['guest_user_id'])){
$_SESSION['guest_user_id'] = GenerateID();
$_SESSION['guest_user_shippingID'] = GenerateID();
}
$page = isset($_GET['p']) ? $_GET['p'] : 'home'; //ha a p-nek van értéke akkor az lesz a page értéke, ha nincs, akkor a login fog betölteni. // jellemzően első betöltéskor lezs ez így.
//href-ekben az url($page)el kéne hivatkozni, az url fv mindig létezik mert az index be include-olja.
if(file_exists("{$page}.php")){
if(isset($_GET['e']) && $_GET['e'] == 1) logOut();
include_once "{$page}.php"; //adott oldal betöltésse
}
else{
include_once "404.php"; // nincs ilyen oldal
}