Pagina laad niet
Ik ben bezig met een forum via een van de phphulp tutorials. Ik ben nu bij inloggen.php, volgens mij staat alles goed, alleen als ik naar die pagina wil gaan, dan lukt dat mij niet. En ook op de doorverwijs pagina krijg ik een error dat ie dat bestandje niet kan includen.
Hier is de code van inloggen.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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?
session_start();
header('Location: forumindex.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
Name : FronzenAge
Description: A two-column, fixed-width template suitable for business sites and blogs.
Version : 1.0
Released : 20071108
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Hattrick Largest Cup - Inloggen</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<!--[if IE]>
<style type="text/css">
#sidebar #calendar {
background-position: 0px 20px;
}
</style>
<![endif]-->
</head>
<body>
<div id="logo">
<h1><a href="#">Hattrick Largest Cup</a></h1>
<h2>Presented by: Yanost & Mikevdveer</a></h2>
</div>
<div id="menu">
<ul>
<li class="first"><a href="index.php" accesskey="1" title="">Home</a></li>
<li><a href="federatie.php" accesskey="2" title="">Federatie</a></li>
<li><a href="hlc.php" accesskey="3" title="">HLC</a></li>
<li><a href="regels.php" accesskey="4" title="">Regels</a></li>
<li><a href="aanmelden.php" accesskey="5" title="">Aanmelden</a></li>
<li><a href="forum.php" accesskey="6" title="">Forum</a></li>
</ul>
<div id="search">
<form action="zoeken.php" method="post">
<input type="text" name="zoek">
<input id="x" type="image" name="imageField" src="images/img10.jpg" />
</form>
</div>
</div>
<hr />
<div id="banner"><img src="images/kophlcwebsite%20copy.jpg" alt="" width="960" height="200" /></div>
<!-- start page -->
<div id="page">
<!-- start content -->
<div id="content">
<div class="post">
<h2 class="title"><a href="#">Inloggen</a></h2>
<div class="entry">
<h3>Inloggen voor deelnemers</h3>
<p>
<?php
error_reporting(E_ALL);
include('connect.php');
// bovenstaan is om alle foutmeldingen op het beeldscherm te zetten.
// en we moeten natuurlijk de verbind.php include omdat we verbinding willen
// met de database
if(isset($_POST['inloggen']))
{
$gebruiker_query = "SELECT * FROM teams WHERE naam = '".mysql_real_escape_string(trim($_POST['naam']))."';";
$gebruiker_sql = mysql_query($gebruiker_query)or die(mysql_error());
$gebruiker_tellen= mysql_num_rows($gebruiker_sql);
if ($gebruiker_tellen == 1){
$rij = mysql_fetch_array($gebruiker_sql);
if(md5($_POST['wachtwoord']) == $rij['wachtwoord']){
$_SESSION['id'] = $rij['id'];
$_SESSION['naam'] = $rij['naam'];
$_SESSION['rank'] = $rij['rank'];
}else{
echo 'Fout bij het inloggen. Probeer het opnieuw';
}
}else{
echo 'Fout bij het inloggen. Probeer het opnieuw';
}
}else{
echo '<table align="center"><form method="POST" action="inloggen.php">';
echo '<tr><td><input type="text" name="naam" value="naam"></td>';
echo '<td><input type="password" name="wachtwoord" value="wachtwoord"></td>';
echo '<td><input type="submit" name="inloggen" value="Inloggen"></td>';
echo '<td><a href="?registreren">Registreren</a></td></tr></form></table>';
}
?>
</p>
</div>
</div>
</div>
<!-- end content -->
<!-- start sidebar -->
<div id="sidebar">
<ul>
<li>
<h2>Kalender</h2>
<?php
require_once('connect.php');
$query = mysql_query("SELECT text, datum AS datum FROM agenda ORDER BY datum ASC") or die(mysql_error());
while($data = mysql_fetch_assoc($query)) {
echo "" . $data['datum'] . " - " . $data['text'] . "<br>";
}
?>
</li>
<li>
<h2>Aanmeldingen</h2>
<p><?php
require_once('connect.php');
$query = mysql_query("SELECT * FROM teams WHERE accepted = '1' ORDER BY id") or die(mysql_error());
while($data = mysql_fetch_assoc($query)) {
echo "- " . $data['teamnaam'] . "<br>";
}
?></p>
</li>
<li>
<h2>Links</h2>
<ul>
<li><a href="www.hattrick.org">Hattrick.org</a></li>
<li><a href="www.alltid.org">Alltid Hattrick</a></li>
<li><a href="http://hattricknieuwsbrief.freehostia.com/">Hattrick Nieuwsbrief (NL)</a></li>
<li><a href="http://www.databased.at/hattrick/">HattriX-Network</a></li>
<li><a href="www.ht-arena.com">HT-Arena</a></li>
<li><a href="http://www.ht-radio.nl/news.php">HT-Radio</a></li>
</ul>
</li>
</ul>
</div>
<!-- end sidebar -->
</div>
<!-- end page -->
<div id="footer">
<p class="legal">Copyright (c) '07-'08 Hattrick Largest Cup. All rights reserved.</p>
<p class="credit">Designed by <a href="http://www.nodethirtythree.com/">NodeThirtyThree</a> + <a href="http://www.freecsstemplates.org/">Free CSS Templates</a></p>
</div>
</body>
</html>
session_start();
header('Location: forumindex.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
Name : FronzenAge
Description: A two-column, fixed-width template suitable for business sites and blogs.
Version : 1.0
Released : 20071108
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Hattrick Largest Cup - Inloggen</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<!--[if IE]>
<style type="text/css">
#sidebar #calendar {
background-position: 0px 20px;
}
</style>
<![endif]-->
</head>
<body>
<div id="logo">
<h1><a href="#">Hattrick Largest Cup</a></h1>
<h2>Presented by: Yanost & Mikevdveer</a></h2>
</div>
<div id="menu">
<ul>
<li class="first"><a href="index.php" accesskey="1" title="">Home</a></li>
<li><a href="federatie.php" accesskey="2" title="">Federatie</a></li>
<li><a href="hlc.php" accesskey="3" title="">HLC</a></li>
<li><a href="regels.php" accesskey="4" title="">Regels</a></li>
<li><a href="aanmelden.php" accesskey="5" title="">Aanmelden</a></li>
<li><a href="forum.php" accesskey="6" title="">Forum</a></li>
</ul>
<div id="search">
<form action="zoeken.php" method="post">
<input type="text" name="zoek">
<input id="x" type="image" name="imageField" src="images/img10.jpg" />
</form>
</div>
</div>
<hr />
<div id="banner"><img src="images/kophlcwebsite%20copy.jpg" alt="" width="960" height="200" /></div>
<!-- start page -->
<div id="page">
<!-- start content -->
<div id="content">
<div class="post">
<h2 class="title"><a href="#">Inloggen</a></h2>
<div class="entry">
<h3>Inloggen voor deelnemers</h3>
<p>
<?php
error_reporting(E_ALL);
include('connect.php');
// bovenstaan is om alle foutmeldingen op het beeldscherm te zetten.
// en we moeten natuurlijk de verbind.php include omdat we verbinding willen
// met de database
if(isset($_POST['inloggen']))
{
$gebruiker_query = "SELECT * FROM teams WHERE naam = '".mysql_real_escape_string(trim($_POST['naam']))."';";
$gebruiker_sql = mysql_query($gebruiker_query)or die(mysql_error());
$gebruiker_tellen= mysql_num_rows($gebruiker_sql);
if ($gebruiker_tellen == 1){
$rij = mysql_fetch_array($gebruiker_sql);
if(md5($_POST['wachtwoord']) == $rij['wachtwoord']){
$_SESSION['id'] = $rij['id'];
$_SESSION['naam'] = $rij['naam'];
$_SESSION['rank'] = $rij['rank'];
}else{
echo 'Fout bij het inloggen. Probeer het opnieuw';
}
}else{
echo 'Fout bij het inloggen. Probeer het opnieuw';
}
}else{
echo '<table align="center"><form method="POST" action="inloggen.php">';
echo '<tr><td><input type="text" name="naam" value="naam"></td>';
echo '<td><input type="password" name="wachtwoord" value="wachtwoord"></td>';
echo '<td><input type="submit" name="inloggen" value="Inloggen"></td>';
echo '<td><a href="?registreren">Registreren</a></td></tr></form></table>';
}
?>
</p>
</div>
</div>
</div>
<!-- end content -->
<!-- start sidebar -->
<div id="sidebar">
<ul>
<li>
<h2>Kalender</h2>
<?php
require_once('connect.php');
$query = mysql_query("SELECT text, datum AS datum FROM agenda ORDER BY datum ASC") or die(mysql_error());
while($data = mysql_fetch_assoc($query)) {
echo "" . $data['datum'] . " - " . $data['text'] . "<br>";
}
?>
</li>
<li>
<h2>Aanmeldingen</h2>
<p><?php
require_once('connect.php');
$query = mysql_query("SELECT * FROM teams WHERE accepted = '1' ORDER BY id") or die(mysql_error());
while($data = mysql_fetch_assoc($query)) {
echo "- " . $data['teamnaam'] . "<br>";
}
?></p>
</li>
<li>
<h2>Links</h2>
<ul>
<li><a href="www.hattrick.org">Hattrick.org</a></li>
<li><a href="www.alltid.org">Alltid Hattrick</a></li>
<li><a href="http://hattricknieuwsbrief.freehostia.com/">Hattrick Nieuwsbrief (NL)</a></li>
<li><a href="http://www.databased.at/hattrick/">HattriX-Network</a></li>
<li><a href="www.ht-arena.com">HT-Arena</a></li>
<li><a href="http://www.ht-radio.nl/news.php">HT-Radio</a></li>
</ul>
</li>
</ul>
</div>
<!-- end sidebar -->
</div>
<!-- end page -->
<div id="footer">
<p class="legal">Copyright (c) '07-'08 Hattrick Largest Cup. All rights reserved.</p>
<p class="credit">Designed by <a href="http://www.nodethirtythree.com/">NodeThirtyThree</a> + <a href="http://www.freecsstemplates.org/">Free CSS Templates</a></p>
</div>
</body>
</html>
Ik snap dus echt niet waarom ik niet op die pagina kan komen... de rest van de pagina's doen het wel.
Want als ik dus naar deze pagina ga dan laad ie eindeloos.
Alvast bedankt.
Mike,
header('Location: forumindex.php');
Waar moet ik die dan plaatsen ergens, tussen/op welke regel(s)?