Geeft witte pagina zonder notices
Ik was weer bezig met me inlog systeem, alleen nu geeft die een witte pagina, zonder notices. Nu zou ik echt niet meer weten wat er fout zit, heb het script al een paar x doorgenomen, maar bij de fout kom ik telkens niet.
Hier de login.php
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
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
<?php
session_start();
error_reporting(E_ALL);
include ("config.php");
include_once ("global.php");
if (isset($_SESSION['login'])){
$ingelogd = 'Je bent al ingelogt, nog een x inloggen kan niet!';
exit;
}
$hash = md5(rand(0, 60));
$hash_id = md5(rand(0, 60));
$ip = $_SERVER['REMOTE_ADDR'];
if (empty($_GET['actie'])){
?>
<form action="login.php?actie=login" method="post" name="form" id="form">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="22%">Gebruikersnaam</td>
<td width="78%"><input type="text" name="user" size="31" /></td>
</tr>
<tr>
<td>Wachtwoord</td>
<td><input type="password" name="pass" size="31" /></td>
</tr>
</table>
<p>
<input name="submit2" type="submit" value="login" />
</p>
</form>
<?
}
else
{
$query = "SELECT * FROM leden WHERE user='".$_POST['user']."'";
$result = mysql_query($query) or die (mysql_error());
$mnr = mysql_num_rows($result);
$sql = mysql_fetch_assoc($result);
if($mnr == 0) {
echo "Je hebt een verkeerd wachtwoord en/of een verkeerde gebruikersnaam ingevuld!";
exit;
}
if (StrtoLower($_POST['user']) == $sql['user'] AND $_POST['pass'] == $sql['pass']){
$id = $sql['id'];
setcookie("hash","$hash",time()+3600*24*356);
setcookie("id","$id",time()+3600*24*356);
setcookie("hash_id","$hash_id",time()+3600*24*356);
$rResult = mysql_query("INSERT INTO hash (id, hash, hash_id, user) VALUES ('','".$hash."','".$hash_id."', '".StrtoLower($_POST['user'])."')") or die (mysql_error());
$LResult = mysql_query("UPDATE leden SET ip='".$ip."' WHERE user='".$_POST['user']."'") or die (mysql_error());
echo "Je bent ingelogd! Je wordt over 5 seconden doorgestuurd naar de index pagina. <META HTTP-EQUIV='refresh' CONTENT='5; URL=index.php'>";
}
else
{
echo "Je hebt een verkeerd wachtwoord en/of een verkeerde gebruikersnaam ingevuld!";
}
}
?>
session_start();
error_reporting(E_ALL);
include ("config.php");
include_once ("global.php");
if (isset($_SESSION['login'])){
$ingelogd = 'Je bent al ingelogt, nog een x inloggen kan niet!';
exit;
}
$hash = md5(rand(0, 60));
$hash_id = md5(rand(0, 60));
$ip = $_SERVER['REMOTE_ADDR'];
if (empty($_GET['actie'])){
?>
<form action="login.php?actie=login" method="post" name="form" id="form">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="22%">Gebruikersnaam</td>
<td width="78%"><input type="text" name="user" size="31" /></td>
</tr>
<tr>
<td>Wachtwoord</td>
<td><input type="password" name="pass" size="31" /></td>
</tr>
</table>
<p>
<input name="submit2" type="submit" value="login" />
</p>
</form>
<?
}
else
{
$query = "SELECT * FROM leden WHERE user='".$_POST['user']."'";
$result = mysql_query($query) or die (mysql_error());
$mnr = mysql_num_rows($result);
$sql = mysql_fetch_assoc($result);
if($mnr == 0) {
echo "Je hebt een verkeerd wachtwoord en/of een verkeerde gebruikersnaam ingevuld!";
exit;
}
if (StrtoLower($_POST['user']) == $sql['user'] AND $_POST['pass'] == $sql['pass']){
$id = $sql['id'];
setcookie("hash","$hash",time()+3600*24*356);
setcookie("id","$id",time()+3600*24*356);
setcookie("hash_id","$hash_id",time()+3600*24*356);
$rResult = mysql_query("INSERT INTO hash (id, hash, hash_id, user) VALUES ('','".$hash."','".$hash_id."', '".StrtoLower($_POST['user'])."')") or die (mysql_error());
$LResult = mysql_query("UPDATE leden SET ip='".$ip."' WHERE user='".$_POST['user']."'") or die (mysql_error());
echo "Je bent ingelogd! Je wordt over 5 seconden doorgestuurd naar de index pagina. <META HTTP-EQUIV='refresh' CONTENT='5; URL=index.php'>";
}
else
{
echo "Je hebt een verkeerd wachtwoord en/of een verkeerde gebruikersnaam ingevuld!";
}
}
?>
En de global.php
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
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
<?php
session_start();
error_reporting(E_ALL);
include ("config.php");
// \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// ---------------------------------------------------------------
// Login systeem script
// ---------------------------------------------------------------
// \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
if (!isset($_COOKIE['hash']) || !isset($_COOKIE['id']) || !isset($_COOKIE['hash_id'])){
echo "";
exit;
}
elseif (isset($_COOKIE['id'])){
$query = "SELECT * FROM leden WHERE id='".$_COOKIE['id']."'";
$result=mysql_query($query) or die (mysql_error());
while ($sql = mysql_fetch_assoc($result)) {
$Hquery = "SELECT * FROM hash WHERE hash_id='".$_COOKIE['hash_id']."'";
$Hresult=mysql_query($Hquery) or die (mysql_error());
while ($Hsql = mysql_fetch_assoc($Hresult)) {
if (!isset($_SESSION['login'])){
if ($_COOKIE['hash'] == $Hsql['hash'] && $_COOKIE['id'] == $sql['id'] && $Hsql['user'] == $sql['user']){
$login = "ja";
$status = $sql['status'];
$naam = $sql['user'];
session_register('login');
session_register('status');
session_register('naam');
setcookie("naam","$naam",time()+3600*24*356);
}
}
}
}
}
// \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// ---------------------------------------------------------------
//
// ---------------------------------------------------------------
// \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
?>
session_start();
error_reporting(E_ALL);
include ("config.php");
// \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// ---------------------------------------------------------------
// Login systeem script
// ---------------------------------------------------------------
// \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
if (!isset($_COOKIE['hash']) || !isset($_COOKIE['id']) || !isset($_COOKIE['hash_id'])){
echo "";
exit;
}
elseif (isset($_COOKIE['id'])){
$query = "SELECT * FROM leden WHERE id='".$_COOKIE['id']."'";
$result=mysql_query($query) or die (mysql_error());
while ($sql = mysql_fetch_assoc($result)) {
$Hquery = "SELECT * FROM hash WHERE hash_id='".$_COOKIE['hash_id']."'";
$Hresult=mysql_query($Hquery) or die (mysql_error());
while ($Hsql = mysql_fetch_assoc($Hresult)) {
if (!isset($_SESSION['login'])){
if ($_COOKIE['hash'] == $Hsql['hash'] && $_COOKIE['id'] == $sql['id'] && $Hsql['user'] == $sql['user']){
$login = "ja";
$status = $sql['status'];
$naam = $sql['user'];
session_register('login');
session_register('status');
session_register('naam');
setcookie("naam","$naam",time()+3600*24*356);
}
}
}
}
}
// \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// ---------------------------------------------------------------
//
// ---------------------------------------------------------------
// \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
?>
bvd. Thomas
Er zijn nog geen reacties op dit bericht.