cookie wilt niet registreren
Oke ik gebruik login_success.php voor het maken van de cookie:
Die verwijst naar admin_index.php en daar gaat die ook naar toe maar het bestand verwijst het gelijk terug omdat de cookie voor één of andere reden niet is aangemaakt en ik kom er maar niet achter.
admin_index.php
Dit is mijn eerste project dus ik weet dat ik dingen fout doe zoals:
Meerdere keren het menu in plaats van één keer header.php include doen enz...
Maar daar leer je van en dat doe ik volgende keer beter maar ik weet niet wat er mis is aan deze cookie code.
en dit is logout script voor de zekerheid.
hele bestanden:
login_succes.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
71
72
73
74
75
76
77
78
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
<?php
setcookie("login", "", time()+3600, "/");
?>
<html>
<head>
<title>Shell foto album</title>
</head>
<body bgcolor="#FFFFCC">
<table id="banner" width="100%" border="3" background="foto/banner/midden.jpg">
<tr> <!-- =banner-->
<td>
<img src="foto/banner/banner rechts.png" height="100" align="right">
<img src="foto/banner/banner links.png" height="100" align="left">
</td>
</table>
<table id="menu" align="center" width="100%" border="0" cellspacing="5" background ="foto/menu/menu.png" >
<tr > <!--inhoud van menu-->
<td width="12%"><!-- niks invullen hier-->
<td width="10%" align="center" background=""><a href="index.php"><font color="#000000"><b>Foto album</b></font></a>
<td width="10%" align="left" background=""><a href="test.html"><font color="#000000"><b>Sorteren</b></font></a>
<td width="10%" align="left" background=""><a href="upload_foto.php"><font color="#000000"><b>Nieuwe foto</b></font></a>
<td width="10%" align="left" background=""><a href="upload album.php"><font color="#000000"><b>Nieuwe album</b></font></a>
<td width="10%" align="left" background=""><a href="register.php"><font color="#000000"><b>Registeren</b></font></a>
<td width="10%" align="left" background=""><a href="main login.php"><font color="#000000"><b>Login</b></font></a>
<td width="10%" align="left" background=""><a href="logout.php"><font color="#000000"><b>Logout</b></font></a>
</table>
<table id="inhoud" height="100" width="100%" border="0" cellspacing="45" bgcolor="">
<tr valign="top" >
<td bgcolor="#EEEEEE" height="200" width="80%"><!--foto's-->
<br>
<br>
<br>
<center>
Successvol
<br>
<br>
<br>
Wacht 2 seconden aub...
</center>
<tr>
</table>
<table id="onderstuk" height="24" width="100%" border="2" colspanning="2">
<tr background="foto/menu/voet.png" align="center">
<td> Jermey & Enes
</table>
</body>
</html>
<html>
<body>
</body>
</html>
<?php
header("Refresh: 2; url=\"admin_index.php\"");
?>
admin_index.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
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
<?php
if(!isset($_COOKIE['login']))
{
header("Refresh: 0; url=\"index.php\"");
}
?>
<html>
<head>
<title>Shell foto album</title>
</head>
<body bgcolor="#FFFFCC">
<table id="banner" width="100%" border="3" background="foto/banner/midden.jpg">
<tr> <!-- =banner-->
<td>
<img src="foto/banner/banner rechts.png" height="100" align="right">
<img src="foto/banner/banner links.png" height="100" align="left">
</td>
</table>
<table id="menu" align="center" width="100%" border="0" cellspacing="5" background ="foto/menu/menu.png" >
<tr > <!--inhoud van menu-->
<td width="12%"><!-- niks invullen hier-->
<td width="10%" align="center" background=""><a href="index.php"><font color="#000000"><b>Foto album</b></font></a>
<td width="10%" align="left" background=""><a href="test.html"><font color="#000000"><b>Sorteren</b></font></a>
<td width="10%" align="left" background=""><a href="upload_foto.php"><font color="#000000"><b>Nieuwe foto</b></font></a>
<td width="10%" align="left" background=""><a href="upload album.php"><font color="#000000"><b>Nieuwe album</b></font></a>
<td width="10%" align="left" background=""><a href="register.php"><font color="#000000"><b>Registeren</b></font></a>
<td width="10%" align="left" background=""><a href="main login.php"><font color="#000000"><b>Login</b></font></a>
<td width="10%" align="left" background=""><a href="logout.php"><font color="#000000"><b>Logout</b></font></a>
</table>
<table id="inhoud" height="100" width="100%" border="0" cellspacing="45" bgcolor="">
<tr valign="top" >
<td bgcolor="#FFD700" width="25%"><!--albums-->
<?php
include 'album.php';
$result = mysql_query("SELECT * FROM album") or die(mysql_error());
?>
<td bgcolor="#EEEEEE" height="200" width="80%"><!--foto's-->
<?php
include 'foto.php';
$result = mysql_query("SELECT * FROM foto") or die(mysql_error());
?>
<tr>
</table>
<table id="onderstuk" height="24" width="100%" border="2" colspanning="2">
<tr background="foto/menu/voet.png" align="center">
<td> Jermey & Enes
</table>
</body>
</html>
logout.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
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
<?
if(isset($_COOKIE['login'])) {
setcookie("login", "", time()-3600);
}
?>
<html>
<head>
<title>Shell foto album</title>
</head>
<body bgcolor="#FFFFCC">
<table id="banner" width="100%" border="3" background="foto/banner/midden.jpg">
<tr> <!-- =banner-->
<td>
<img src="foto/banner/banner links.png" height="100" align="left">
<img src="foto/banner/banner rechts.png" height="100" align="right">
</td>
</table>
<table id="menu" align="center" width="100%" border="0" cellspacing="5" background ="foto/menu/menu.png" >
<tr > <!--inhoud van menu-->
<td width="12%"><!-- niks invullen hier-->
<td width="10%" align="center" background=""><a href="index.php"><font color="#000000"><b>Foto album</b></font></a>
<td width="10%" align="left" background=""><a href="test.html"><font color="#000000"><b>Sorteren</b></font></a>
<td width="10%" align="left" background=""><a href="upload_foto.php"><font color="#000000"><b>Nieuwe foto</b></font></a>
<td width="10%" align="left" background=""><a href="upload album.php"><font color="#000000"><b>Nieuwe album</b></font></a>
<td width="10%" align="left" background=""><a href="register.php"><font color="#000000"><b>Registeren</b></font></a>
<td width="10%" align="left" background=""><a href="main login.php"><font color="#000000"><b>Login</b></font></a>
<td width="10%" align="left" background=""><a href="logout.php"><font color="#000000"><b>Logout</b></font></a>
</table>
<table id="inhoud" height="100" width="100%" border="0" cellspacing="45" bgcolor="">
<tr align="center">
<td bgcolor="#EEEEEE" height="200" width="80%" >
U bent niet meer ingelogd
</table>
<table id="onderstuk" height="24" width="100%" border="2" colspanning="2">
<tr background="foto/menu/voet.png" align="center">
<td> Jermey & Enes
</table>
</body>
</html>
<?php
header("Refresh: 2; url=\"index.php\"");
?>
Toevoeging op 08/06/2011 00:55:32:
Het staat er nu wel sorry had wat problemen met posten alvast bedankt,
Jermey
Gewijzigd op 08/06/2011 00:54:31 door Jermey Jungbeker
Een oplossing voor dit probleem is door de redirect in de header te zetten:
Zie http://www.webmasterworld.com/forum88/6846.htm
Was tot 4 uur bezig in de nacht gisteren dus werd pas om 2 uur wakker sorry voor de laatste reactie.
Jermey