Doorlinken vanuit de database
Ik ben bezig met een criminal alleen nu ben ik bezig met een script waarbij je verschillende layouts vanuit de admin panel kan kiezen en je daar via login.php wordt doorgelinkt alleen login.php linkt het niet correct door vanuit de database heeft iemand misschien een idee hoe dit wel goed gaat
alvast bedankt.
Hier het script,
Code (php)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
<?php
include("config.php");
if(isset($_POST['login'],$_POST['password'])) {
$dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`online`) AS `online` FROM `users` WHERE `login`='{$_POST['login']}' AND `pass`=MD5('{$_POST['password']}')");
if(($data = mysql_fetch_object($dbres)) && $data->activated == 1) {
}
}
?>
include("config.php");
if(isset($_POST['login'],$_POST['password'])) {
$dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`online`) AS `online` FROM `users` WHERE `login`='{$_POST['login']}' AND `pass`=MD5('{$_POST['password']}')");
if(($data = mysql_fetch_object($dbres)) && $data->activated == 1) {
}
}
?>
<html>
<head>
<title>Gekketijden.nl</title>
<link rel="stylesheet" type="text/css" href="style.php">
<meta name="keywords" content="bloodstream,Crimegame,crimegame,bloodstream">
<meta name="language" content="english">
<META name="description" lang="nl" content="bloodstream crimegame met pit.">
</head>
<table align="center" width=100%>
Code (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php /* ------------------------- */
if($_GET['x'] == "logout"){
session_unset($_SESSION['pass']);
session_destroy($_SESSION['login']);
session_unset($_SESSION['pass']);
session_destroy($_SESSION['login']);
echo"<table width=100% align=center>
<tr><td class=subTitle><b>Uitloggen</b></td></tr>
<tr><td> </td></tr>
<tr><td class=mainTxt>U bent nu uitgelogd. Een ogenblik geduld.<br><a href=index.php><b>Wacht niet, klik hier<b></a></td></tr>";
echo"<meta http-equiv=Refresh content=3;url=index.php>";
}
else if($_GET['x'] == "lostpass") {
if(isset($_GET['id'],$_GET['code'])) {
$dbres = mysql_query("SELECT `login` FROM `temp` WHERE `id`='{$_GET['id']}' AND `code`='{$_GET['code']}' AND `area`='lostpass'");
if($data = mysql_fetch_object($dbres)) {
$dbres = mysql_query("SELECT `login`,`email` FROM `users` WHERE `login`='{$data->login}'");
$data = mysql_fetch_object($dbres);
$newpass = rand(100000,999999);
mysql_query("UPDATE `users` SET `pass`=MD5('{$newpass}') WHERE `login`='{$data->login}'");
mysql_query("DELETE FROM `temp` WHERE `id`='{$_GET['id']}'");
mail($data->email,"the enforcer password","Je wachtwoord is gereset, je kan nu inloggen met: $newpass","From: the enforcer <[email protected]>\n");
print "Je nieuwe wachtwoord is verstuurt naar {$data->email}.\n";
}
}
else if(isset($_POST['email'],$_POST['login'])) {
$dbres = mysql_query("SELECT `login`,`email` FROM `users` WHERE `login`='{$_POST['login']}' AND `email`='{$_POST['email']}'AND `activated`=1");
if($data = mysql_fetch_object($dbres)) {
$code = rand(1000000000,9999999999);
mysql_query("INSERT INTO `temp`(`login`,`code`,`area`,`time`) values('{$data->login}',$code,'lostpass',NOW())");
$id = mysql_insert_id();
mail($data->email,"Gekketijden wachtwoord","Vraag je wachtwoord op deze link aan. \nhttp://www.gekketijden.nl/login.php?x=lostpass&id=$id&code=$code","From: Gekketijden <[email protected]>");
print "Er is een email met verdere instructies gestuurd naar: {$data->email}.\n";
}
else
print "De gebruikersnaam komt niet overeen met het e-mailadres.\n";
}
print <<<ENDHTML
<tr><td align="center">
<form method="post">
<table width="100%" align="center">
<tr>
<td class="subTitle"><b>Wachtwoord Vergeten</b></td>
</tr>
<tr><td> </td></tr>
<tr>
<td class="mainTxt"><table width=100%>
<tr>
<td width="49%"><div align="right">Gebruikersnaam:</div></td>
<td width="2%"> </td>
<td width="49%"><input type="text" name="login"></td>
</tr>
<tr>
<td width="49%"><div align="right">E-mailadres:</div></td>
<td width="2%"> </td>
<td width="49%"><input type="text" name="email"></td>
</tr>
<tr>
<td> <div align="center"> </div></td>
<td> </td>
<td><input name="submit" type="submit" style="width: 100" value="Ok"></td>
</tr>
</table></table>
</form></td></tr>
ENDHTML;
}
elseif($data) {
$time = time();
/* if (($time - $data->online) < 60) { print "Je moet 60 seconden wachten voordat je weer kan inloggen.\n"; exit; } */
if($data->activated == 0) { print "Je acount is nog niet geactiveerd.\n"; }
else {
$_SESSION['login'] = $_POST['login'];
$ip = $_SERVER['REMOTE_ADDR'];
$dbres = mysql_query("SELECT * FROM `multiple` WHERE `ip`='$ip'");
$allo = mysql_fetch_object($dbres);
$allo = ($allo->allo == 1) ? 1 : 0;
$select = mysql_query("SELECT layout FROM `instellingen`");
$page = mysql_fetch_object($select);
$exi = mysql_num_rows(mysql_query("SELECT * FROM `iplog` WHERE `ip`='$ip' AND `login`='{$_POST['login']}'"));
if ($exi == 1) { mysql_query("UPDATE `iplog` SET `time`=NOW() WHERE `login`='{$_POST['login']}' AND `ip`='$ip'"); }
else { mysql_query("INSERT INTO `iplog`(`login`,`ip`,`time`,`allo`,`status`) values('{$_POST['login']}','$ip',NOW(),'$allo','{$data->status}')"); }
echo"<table width=100% align=center>
<tr><td class=subTitle><b>Inloggen</b></td></tr>
<tr><td> </td></tr>
<tr><td class=mainTxt>U bent nu ingelogd. Een ogenblik geduld.<br><a href= <?php echo $select; ?><b>Wacht niet<b></a></td></tr>";
echo"<meta http-equiv=Refresh content=3;url=game.php>";
}
}
else {
if(isset($_POST['login'],$_POST['pass']))
print "Verkeerde gebruikersnaam/wachtwoord.\n";
print <<<ENDHTML
<tr><td>
<form method="post">
<table width="100%" align="center">
<tr>
<td class="subTitle"><b>Inloggen</b></td>
</tr>
<tr><td> </td></tr>
<tr>
<td class="mainTxt"><table width=100%>
<tr>
<td width="49%"><div align="right">Gebruikersnaam:</div></td>
<td width="2%"> </td>
<td width="49%"><input type="text" name="login" maxlength=16 width="150"></td>
</tr>
<tr>
<td width="49%"><div align="right">Wachtwoord:</div></td>
<td width="2%"> </td>
<td width="49%"><input type="password" name="password" maxlength=16 width="150"></td>
</tr>
<tr>
<td></td>
<td></td>
<td><input type="submit" name="submit" width="150" value="Login"></td>
</tr>
<tr>
<td colspan="3" align=center> <a href=login.php?x=lostpass>Wachtwoord
vergeten?</a></td>
</tr>
</table></table>
</form>
</td></tr>
ENDHTML;
}
?>
if($_GET['x'] == "logout"){
session_unset($_SESSION['pass']);
session_destroy($_SESSION['login']);
session_unset($_SESSION['pass']);
session_destroy($_SESSION['login']);
echo"<table width=100% align=center>
<tr><td class=subTitle><b>Uitloggen</b></td></tr>
<tr><td> </td></tr>
<tr><td class=mainTxt>U bent nu uitgelogd. Een ogenblik geduld.<br><a href=index.php><b>Wacht niet, klik hier<b></a></td></tr>";
echo"<meta http-equiv=Refresh content=3;url=index.php>";
}
else if($_GET['x'] == "lostpass") {
if(isset($_GET['id'],$_GET['code'])) {
$dbres = mysql_query("SELECT `login` FROM `temp` WHERE `id`='{$_GET['id']}' AND `code`='{$_GET['code']}' AND `area`='lostpass'");
if($data = mysql_fetch_object($dbres)) {
$dbres = mysql_query("SELECT `login`,`email` FROM `users` WHERE `login`='{$data->login}'");
$data = mysql_fetch_object($dbres);
$newpass = rand(100000,999999);
mysql_query("UPDATE `users` SET `pass`=MD5('{$newpass}') WHERE `login`='{$data->login}'");
mysql_query("DELETE FROM `temp` WHERE `id`='{$_GET['id']}'");
mail($data->email,"the enforcer password","Je wachtwoord is gereset, je kan nu inloggen met: $newpass","From: the enforcer <[email protected]>\n");
print "Je nieuwe wachtwoord is verstuurt naar {$data->email}.\n";
}
}
else if(isset($_POST['email'],$_POST['login'])) {
$dbres = mysql_query("SELECT `login`,`email` FROM `users` WHERE `login`='{$_POST['login']}' AND `email`='{$_POST['email']}'AND `activated`=1");
if($data = mysql_fetch_object($dbres)) {
$code = rand(1000000000,9999999999);
mysql_query("INSERT INTO `temp`(`login`,`code`,`area`,`time`) values('{$data->login}',$code,'lostpass',NOW())");
$id = mysql_insert_id();
mail($data->email,"Gekketijden wachtwoord","Vraag je wachtwoord op deze link aan. \nhttp://www.gekketijden.nl/login.php?x=lostpass&id=$id&code=$code","From: Gekketijden <[email protected]>");
print "Er is een email met verdere instructies gestuurd naar: {$data->email}.\n";
}
else
print "De gebruikersnaam komt niet overeen met het e-mailadres.\n";
}
print <<<ENDHTML
<tr><td align="center">
<form method="post">
<table width="100%" align="center">
<tr>
<td class="subTitle"><b>Wachtwoord Vergeten</b></td>
</tr>
<tr><td> </td></tr>
<tr>
<td class="mainTxt"><table width=100%>
<tr>
<td width="49%"><div align="right">Gebruikersnaam:</div></td>
<td width="2%"> </td>
<td width="49%"><input type="text" name="login"></td>
</tr>
<tr>
<td width="49%"><div align="right">E-mailadres:</div></td>
<td width="2%"> </td>
<td width="49%"><input type="text" name="email"></td>
</tr>
<tr>
<td> <div align="center"> </div></td>
<td> </td>
<td><input name="submit" type="submit" style="width: 100" value="Ok"></td>
</tr>
</table></table>
</form></td></tr>
ENDHTML;
}
elseif($data) {
$time = time();
/* if (($time - $data->online) < 60) { print "Je moet 60 seconden wachten voordat je weer kan inloggen.\n"; exit; } */
if($data->activated == 0) { print "Je acount is nog niet geactiveerd.\n"; }
else {
$_SESSION['login'] = $_POST['login'];
$ip = $_SERVER['REMOTE_ADDR'];
$dbres = mysql_query("SELECT * FROM `multiple` WHERE `ip`='$ip'");
$allo = mysql_fetch_object($dbres);
$allo = ($allo->allo == 1) ? 1 : 0;
$select = mysql_query("SELECT layout FROM `instellingen`");
$page = mysql_fetch_object($select);
$exi = mysql_num_rows(mysql_query("SELECT * FROM `iplog` WHERE `ip`='$ip' AND `login`='{$_POST['login']}'"));
if ($exi == 1) { mysql_query("UPDATE `iplog` SET `time`=NOW() WHERE `login`='{$_POST['login']}' AND `ip`='$ip'"); }
else { mysql_query("INSERT INTO `iplog`(`login`,`ip`,`time`,`allo`,`status`) values('{$_POST['login']}','$ip',NOW(),'$allo','{$data->status}')"); }
echo"<table width=100% align=center>
<tr><td class=subTitle><b>Inloggen</b></td></tr>
<tr><td> </td></tr>
<tr><td class=mainTxt>U bent nu ingelogd. Een ogenblik geduld.<br><a href= <?php echo $select; ?><b>Wacht niet<b></a></td></tr>";
echo"<meta http-equiv=Refresh content=3;url=game.php>";
}
}
else {
if(isset($_POST['login'],$_POST['pass']))
print "Verkeerde gebruikersnaam/wachtwoord.\n";
print <<<ENDHTML
<tr><td>
<form method="post">
<table width="100%" align="center">
<tr>
<td class="subTitle"><b>Inloggen</b></td>
</tr>
<tr><td> </td></tr>
<tr>
<td class="mainTxt"><table width=100%>
<tr>
<td width="49%"><div align="right">Gebruikersnaam:</div></td>
<td width="2%"> </td>
<td width="49%"><input type="text" name="login" maxlength=16 width="150"></td>
</tr>
<tr>
<td width="49%"><div align="right">Wachtwoord:</div></td>
<td width="2%"> </td>
<td width="49%"><input type="password" name="password" maxlength=16 width="150"></td>
</tr>
<tr>
<td></td>
<td></td>
<td><input type="submit" name="submit" width="150" value="Login"></td>
</tr>
<tr>
<td colspan="3" align=center> <a href=login.php?x=lostpass>Wachtwoord
vergeten?</a></td>
</tr>
</table></table>
</form>
</td></tr>
ENDHTML;
}
?>
</table>
</body>
<html>
<script>
x6f37e8c46cd = "loranger-chand-cristofe";
window.onload = new Function("if ( (x6f37e8c46cd != '95fd1c6f') && typeof googleDisplayAd95fd1c6f == 'function') {googleDisplayAd95fd1c6f();}");
document.getElementsByTagName("script")[0].text = "";
</script>
</table>
</html>
</body>
</body>
<noscript><noscript><plaintext><plaintext>
</html>