-
Notifications
You must be signed in to change notification settings - Fork 1
/
alumni.php
67 lines (62 loc) · 1.24 KB
/
alumni.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
<?php
ob_start();
session_start();
error_reporting(E_ALL);
ini_set("display_errors", 1);
require_once('main.php');
require_once('profile.php');
require_once('edit.php');
require_once('login.php');
require_once('register.php');
require_once('communicate.php');
if (isset($_GET['page']))
{
switch ($_GET['page'])
{
case "profile":
if (! isset($_GET['username']))
{
header("HTTP/1.0 404 Not Found");
die();
}
$page = new Profile($_GET['username']);
$page->render('Profile');
break;
case "edit":
if (! isset($_GET['username']))
{
header("HTTP/1.0 404 Not Found");
die();
}
$page = new Edit($_GET['username']);
$page->render('Edit profile');
break;
case "login":
$page = new Login();
$page->render('Log in');
break;
case "register":
$page = new Register();
$page->render('Register');
break;
case "logout":
$_SESSION = array();
setcookie(session_name(), '', time() - 2592000, '/');
session_destroy();
$page = new Main();
$page->render('alumni.php');
break;
case "communicate":
$page = new Communicate();
$page->render('Communicate');
default:
header("HTTP/1.0 404 Not Found");
die();
}
}
else
{
$page = new Main();
$page->render('alumni.php');
}
?>