-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
76 lines (43 loc) · 1.47 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
//error_reporting (1);
include("config.php");
include("functions.php");
session_start();
/**
index.php File
© @ Realityhost.nl
Created at 7-1-2009 (dd/mm/yyyy) at 11:00
**/
/** Als er geen sessie is ga je naar de login pagina **/
if(empty($_SESSION['username']) OR empty($_SESSION['password'])) {
include("login.php"); /// login file includen
return;
}
/** Eind **/
$username = $_SESSION['username'];
$password = $_SESSION['password'];
/** Diverse logins checks op echtheid etc. **/
if(!empty($_SESSION['username']) OR !empty($_SESSION['password'])) {
$check_sql = "SELECT * FROM users WHERE username='".$_SESSION['username']."' AND password='".$_SESSION['password']."' LIMIT 1";
$check_query = mysql_query($check_sql) or die("Error, please close this session and try again.");
$this_user = mysql_fetch_assoc($check_query);
/** Login Check op echtheid **/
if(mysql_num_rows($check_query) != "1") {
session_destroy();
/** Sesie is verwijderd en je gaat weer terug naar de login. **/
echo " <META http-equiv=\"refresh\" content=\"1; URL=./index.php\"> ";
return;
}
/** Einde login check **/
/*** Kijken of de users zijn ip wel gelijkt blijft , ivm sesie hijacking **/
/**
if($ip != $_SESSION['ip'] OR $ip != $this_user['ip']) {
session_destroy();
echo " <META http-equiv=\"refresh\" content=\"1; URL=./index.php\"> ";
return;
}
/** Einde ip check **/
include("./main.php");
return;
}
?>