-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
44 lines (39 loc) · 790 Bytes
/
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
<?php
function sanitize_input($input_string)
{
$input_string = strip_tags($input_string);
$input_string = mysql_real_escape_string($input_string);
return $input_string;
}
session_start();
$db = mysqli_connect("localhost","root","","mailomat");
if (!$db) {
echo mysqli_connect_error();
return;
}
if(isset($_GET["a"])) {
$action=$_GET["a"];
switch ($action) {
case 'login':
include($action . ".php");
break;
case 'register':
include($action . ".php");
break;
case 'logout':
include($action . ".php");
break;
case'sendmessage':
include($action . ".php");
break;
case 'overview':
include($action . ".php");
break;
default:
include('404.php');
break;
}
} else {
include('start.php');
}
?>