refresh
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
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
<?
session_start();
include("config.php");
include("functions.php");
if(!isset($_COOKIE['last_active']))
{
if(isset($_SESSION['user_id']))
{
mysql_query("UPDATE tbl_users SET user_lastactive = NOW() WHERE user_id = '" . $_SESSION['user_id'] . "'") or die(mysql_error());
setcookie("last_active",true,time()+5);
}
}
if(!isset($_SESSION['user_id']))
{
if(isset($_POST['login']))
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_name = '" . $_POST['user'] . "' AND user_pass = '" . md5($_POST['pass']) . "'");
$result = mysql_num_rows($query);
if(empty($result))
{
echo "<script>alert('Hata.'); document.location.href=('login.php')</script>";
}
else
{
while($row = mysql_fetch_assoc($query))
{
$user_id = $row['user_id'];
}
header("Location: login.php");
$_SESSION['user_id'] = $user_id;
}
}
else
{
?>
<input type="hidden" value="1" name="login">
<table border="0" width="100%" id="table73">
<tr>
<td width="187"><b>
Gebruikersnaam : </b> </td>
<td> <input type="text" name="user" maxlength="15" size="31"></td>
</tr>
<tr>
<td width="187"><b>
Wachtwoord : </b> </td>
<td> <input type="password" name="pass" maxlength="15" size="31"></td>
</tr>
</table>
<table border="0" width="100%" id="table74">
<tr>
<td> </td>
<td width="152">
<input type="submit" value="Login">
</tr>
</table>
<address>
</address>
<table border="0" width="100%" id="table75">
<tr>
<td align="center">
<img src="images/icons/register.gif"> <a href="register.php">Registreren</a></td>
<td align="center">
<img src="images/icons/memberlist.gif"> <a href="memberlist.php">Ledenlijst</a>
</table>
<?
}
}
else
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_id = '" . $_SESSION['user_id'] . "'");
while($row = mysql_fetch_assoc($query))
{
echo "Gebruikersnaam : <b>" . $row['user_name']. "</b>";
if($row['user_pm'])
{
$msg = mysql_result(mysql_query("SELECT COUNT(1) FROM tbl_msg WHERE msg_to = '" . $_SESSION['user_id'] . "'"),0);
if(empty($msg))
{
$msg = "<font color=\"#008000\">Empty</font>";
}
elseif($msg >= $cfg['max_msg'])
{
$msg = "<font color=\"#FF0000\">FULL</font>";
}
else
{
$msg = $msg . " / " . $cfg['max_msg'];
}
echo "<br>\n";
echo "Inbox : <b>". $msg ."</b> ( <a href=\"msg.php?act=inbox\">Bekijken</a> )";
}
}
echo "<br>\n<br>\n";
if(isset($_SESSION['admin_login']))
{
echo "<img src=\"images/icons/admin.gif\"> <a href=\"admin.php\">Admin</a>";
echo "<br>\n";
}
echo "<img src=\"images/icons/memberlist.gif\"> <a href=\"memberlist.php\">Ledenlijst</a>";
echo "<br>\n";
echo "<img src=\"images/icons/profile.gif\"> <a href=\"profile.php?act=edit_profile\">Verander Profiel</a>";
echo "<br>\n";
echo "<img src=\"images/icons/profile.gif\"> <a href=\"profile.php?act=view&user_id=" . $_SESSION['user_id'] . "\">Bekijk Profiel</a>";
echo "<br>\n";
echo "<img src=\"images/icons/logoff.gif\"> <a href=\"logoff.php\">Uitloggen</a>";
}
?>
session_start();
include("config.php");
include("functions.php");
if(!isset($_COOKIE['last_active']))
{
if(isset($_SESSION['user_id']))
{
mysql_query("UPDATE tbl_users SET user_lastactive = NOW() WHERE user_id = '" . $_SESSION['user_id'] . "'") or die(mysql_error());
setcookie("last_active",true,time()+5);
}
}
if(!isset($_SESSION['user_id']))
{
if(isset($_POST['login']))
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_name = '" . $_POST['user'] . "' AND user_pass = '" . md5($_POST['pass']) . "'");
$result = mysql_num_rows($query);
if(empty($result))
{
echo "<script>alert('Hata.'); document.location.href=('login.php')</script>";
}
else
{
while($row = mysql_fetch_assoc($query))
{
$user_id = $row['user_id'];
}
header("Location: login.php");
$_SESSION['user_id'] = $user_id;
}
}
else
{
?>
<input type="hidden" value="1" name="login">
<table border="0" width="100%" id="table73">
<tr>
<td width="187"><b>
Gebruikersnaam : </b> </td>
<td> <input type="text" name="user" maxlength="15" size="31"></td>
</tr>
<tr>
<td width="187"><b>
Wachtwoord : </b> </td>
<td> <input type="password" name="pass" maxlength="15" size="31"></td>
</tr>
</table>
<table border="0" width="100%" id="table74">
<tr>
<td> </td>
<td width="152">
<input type="submit" value="Login">
</tr>
</table>
<address>
</address>
<table border="0" width="100%" id="table75">
<tr>
<td align="center">
<img src="images/icons/register.gif"> <a href="register.php">Registreren</a></td>
<td align="center">
<img src="images/icons/memberlist.gif"> <a href="memberlist.php">Ledenlijst</a>
</table>
<?
}
}
else
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_id = '" . $_SESSION['user_id'] . "'");
while($row = mysql_fetch_assoc($query))
{
echo "Gebruikersnaam : <b>" . $row['user_name']. "</b>";
if($row['user_pm'])
{
$msg = mysql_result(mysql_query("SELECT COUNT(1) FROM tbl_msg WHERE msg_to = '" . $_SESSION['user_id'] . "'"),0);
if(empty($msg))
{
$msg = "<font color=\"#008000\">Empty</font>";
}
elseif($msg >= $cfg['max_msg'])
{
$msg = "<font color=\"#FF0000\">FULL</font>";
}
else
{
$msg = $msg . " / " . $cfg['max_msg'];
}
echo "<br>\n";
echo "Inbox : <b>". $msg ."</b> ( <a href=\"msg.php?act=inbox\">Bekijken</a> )";
}
}
echo "<br>\n<br>\n";
if(isset($_SESSION['admin_login']))
{
echo "<img src=\"images/icons/admin.gif\"> <a href=\"admin.php\">Admin</a>";
echo "<br>\n";
}
echo "<img src=\"images/icons/memberlist.gif\"> <a href=\"memberlist.php\">Ledenlijst</a>";
echo "<br>\n";
echo "<img src=\"images/icons/profile.gif\"> <a href=\"profile.php?act=edit_profile\">Verander Profiel</a>";
echo "<br>\n";
echo "<img src=\"images/icons/profile.gif\"> <a href=\"profile.php?act=view&user_id=" . $_SESSION['user_id'] . "\">Bekijk Profiel</a>";
echo "<br>\n";
echo "<img src=\"images/icons/logoff.gif\"> <a href=\"logoff.php\">Uitloggen</a>";
}
?>
Kan iemand me hiermee helpen?
Pas bumpen wanneer 24 uur verstreken zijn......
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
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
<?
session_start();
include("config.php");
include("functions.php");
if(!isset($_COOKIE['last_active']))
{
if(isset($_SESSION['user_id']))
{
mysql_query("UPDATE tbl_users SET user_lastactive = NOW() WHERE user_id = '" . $_SESSION['user_id'] . "'") or die(mysql_error());
setcookie("last_active",true,time()+5);
}
}
if(!isset($_SESSION['user_id']))
{
if(isset($_POST['login']))
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_name = '" . $_POST['user'] . "' AND user_pass = '" . md5($_POST['pass']) . "'");
$result = mysql_num_rows($query);
if(empty($result))
{
echo "<script>alert('Hata.'); document.location.href=('login.php')</script>";
}
else
{
while($row = mysql_fetch_assoc($query))
{
$user_id = $row['user_id'];
}
header("Location: login.php");
$_SESSION['user_id'] = $user_id;
}
}
else
{
?>
<form style="margin: 0px;" action="#" method="post">
<input type="hidden" value="1" name="login">
<table border="0" width="100%" id="table73">
<tr>
<td width="187"><b>
Gebruikersnaam : </b> </td>
<td> <input type="text" name="user" maxlength="15" size="31"></td>
</tr>
<tr>
<td width="187"><b>
Wachtwoord : </b> </td>
<td> <input type="password" name="pass" maxlength="15" size="31"></td>
</tr>
</table>
<table border="0" width="100%" id="table74">
<tr>
<td> </td>
<td width="152">
<input type="submit" value="Login">
</tr>
</table>
</form>
<address>
</address>
<table border="0" width="100%" id="table75">
<tr>
<td align="center">
<img src="images/icons/register.gif"> <a href="register.php">Registreren</a></td>
<td align="center">
<img src="images/icons/memberlist.gif"> <a href="memberlist.php">Ledenlijst</a>
</table>
<?
}
}
else
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_id = '" . $_SESSION['user_id'] . "'");
while($row = mysql_fetch_assoc($query))
{
echo "Gebruikersnaam : <b>" . $row['user_name']. "</b>";
if($row['user_pm'])
{
$msg = mysql_result(mysql_query("SELECT COUNT(1) FROM tbl_msg WHERE msg_to = '" . $_SESSION['user_id'] . "'"),0);
if(empty($msg))
{
$msg = "<font color=\"#008000\">Empty</font>";
}
elseif($msg >= $cfg['max_msg'])
{
$msg = "<font color=\"#FF0000\">FULL</font>";
}
else
{
$msg = $msg . " / " . $cfg['max_msg'];
}
echo "<br>\n";
echo "Inbox : <b>". $msg ."</b> ( <a href=\"msg.php?act=inbox\">Bekijken</a> )";
}
}
echo "<br>\n<br>\n";
if(isset($_SESSION['admin_login']))
{
echo "<img src=\"images/icons/admin.gif\"> <a href=\"admin.php\">Admin</a>";
echo "<br>\n";
}
echo "<img src=\"images/icons/memberlist.gif\"> <a href=\"memberlist.php\">Ledenlijst</a>";
echo "<br>\n";
echo "<img src=\"images/icons/profile.gif\"> <a href=\"profile.php?act=edit_profile\">Verander Profiel</a>";
echo "<br>\n";
echo "<img src=\"images/icons/profile.gif\"> <a href=\"profile.php?act=view&user_id=" . $_SESSION['user_id'] . "\">Bekijk Profiel</a>";
echo "<br>\n";
echo "<img src=\"images/icons/logoff.gif\"> <a href=\"logoff.php\">Uitloggen</a>";
}
?>
[/edit]
session_start();
include("config.php");
include("functions.php");
if(!isset($_COOKIE['last_active']))
{
if(isset($_SESSION['user_id']))
{
mysql_query("UPDATE tbl_users SET user_lastactive = NOW() WHERE user_id = '" . $_SESSION['user_id'] . "'") or die(mysql_error());
setcookie("last_active",true,time()+5);
}
}
if(!isset($_SESSION['user_id']))
{
if(isset($_POST['login']))
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_name = '" . $_POST['user'] . "' AND user_pass = '" . md5($_POST['pass']) . "'");
$result = mysql_num_rows($query);
if(empty($result))
{
echo "<script>alert('Hata.'); document.location.href=('login.php')</script>";
}
else
{
while($row = mysql_fetch_assoc($query))
{
$user_id = $row['user_id'];
}
header("Location: login.php");
$_SESSION['user_id'] = $user_id;
}
}
else
{
?>
<form style="margin: 0px;" action="#" method="post">
<input type="hidden" value="1" name="login">
<table border="0" width="100%" id="table73">
<tr>
<td width="187"><b>
Gebruikersnaam : </b> </td>
<td> <input type="text" name="user" maxlength="15" size="31"></td>
</tr>
<tr>
<td width="187"><b>
Wachtwoord : </b> </td>
<td> <input type="password" name="pass" maxlength="15" size="31"></td>
</tr>
</table>
<table border="0" width="100%" id="table74">
<tr>
<td> </td>
<td width="152">
<input type="submit" value="Login">
</tr>
</table>
</form>
<address>
</address>
<table border="0" width="100%" id="table75">
<tr>
<td align="center">
<img src="images/icons/register.gif"> <a href="register.php">Registreren</a></td>
<td align="center">
<img src="images/icons/memberlist.gif"> <a href="memberlist.php">Ledenlijst</a>
</table>
<?
}
}
else
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_id = '" . $_SESSION['user_id'] . "'");
while($row = mysql_fetch_assoc($query))
{
echo "Gebruikersnaam : <b>" . $row['user_name']. "</b>";
if($row['user_pm'])
{
$msg = mysql_result(mysql_query("SELECT COUNT(1) FROM tbl_msg WHERE msg_to = '" . $_SESSION['user_id'] . "'"),0);
if(empty($msg))
{
$msg = "<font color=\"#008000\">Empty</font>";
}
elseif($msg >= $cfg['max_msg'])
{
$msg = "<font color=\"#FF0000\">FULL</font>";
}
else
{
$msg = $msg . " / " . $cfg['max_msg'];
}
echo "<br>\n";
echo "Inbox : <b>". $msg ."</b> ( <a href=\"msg.php?act=inbox\">Bekijken</a> )";
}
}
echo "<br>\n<br>\n";
if(isset($_SESSION['admin_login']))
{
echo "<img src=\"images/icons/admin.gif\"> <a href=\"admin.php\">Admin</a>";
echo "<br>\n";
}
echo "<img src=\"images/icons/memberlist.gif\"> <a href=\"memberlist.php\">Ledenlijst</a>";
echo "<br>\n";
echo "<img src=\"images/icons/profile.gif\"> <a href=\"profile.php?act=edit_profile\">Verander Profiel</a>";
echo "<br>\n";
echo "<img src=\"images/icons/profile.gif\"> <a href=\"profile.php?act=view&user_id=" . $_SESSION['user_id'] . "\">Bekijk Profiel</a>";
echo "<br>\n";
echo "<img src=\"images/icons/logoff.gif\"> <a href=\"logoff.php\">Uitloggen</a>";
}
?>
[/edit]
@Arjan: de script doet nogsteeds hetzelfde, hij vernieuwd niet of doet niks anders dan hij hoort te doen
Ik ken je systeem niet, maar ik heb wel nu zo gemaakt dat hij in ieder geval de informatie gaat checken.. de form dus, die ontbrak.
Ok, bedankt daarvoor. Maar het probleem in mijn script is dat als ik inlog, krijg ik een leeg scherm, pas als ik de pagina vernieuw krijg ik wat ik wil hebben (ledenmenu).
Gewijzigd op 01/01/1970 01:00:00 door reinhout
wat is die code?
<meta http-equiv="refresh" content="1;url= test.php">
ff in een <head> zetten.
en hoe kan ik deze code verbinden met <input type="submit" value="Login">, want hij moet pas vernieuwen wanneer ik op Login klik
<input type="submit" name="loginactie" value="Login">
en dan de code om het op te vangen is alsvolgd:
if(isset($_POST['loginactie']))
{
///// Hier code wat moet gebeuren als er op de knop is gedrukt......
}
hoop dat je er wat aan hebt..
groetjes
Code (php)
maar hij doet het niet
Wat doet die spatie achter url=
zonder die spatie doet ie het ook niet
giga schreef op 16.06.2007 21:48:
Ziet er niet zo netjes uit :fout: ..
doe dan via een header naar een andere pagina waar je wel gewoon een <meta> in de head kunt zetten en niet <body><head></head></body>
Klopt deze code? Zo ja, waarom doet ie het niet? Zo nee, welke code moet ik dan gebruiken?
Arjan Schuurman schreef op 17.06.2007 11:06:
Ziet er niet zo netjes uit :fout: ..
doe dan via een header naar een andere pagina waar je wel gewoon een <meta> in de head kunt zetten en niet <body><head></head></body>
giga schreef op 16.06.2007 21:48:
Ziet er niet zo netjes uit :fout: ..
doe dan via een header naar een andere pagina waar je wel gewoon een <meta> in de head kunt zetten en niet <body><head></head></body>
Hoe moet ik die header doen?
bump
help! ik moet de site morgen leveren
Hoe meer je bumpt, hoe minder ik zin heb je te helpen.