Waarom werkt dit niet?
Dit is men config.php:
PHP Code:
<?php
error_reporting(E_ALL);
if ((!empty($_POST['gebruikersnaam']))&&(!empty($_POST['paswoord']))) {
session_start();
$_SESSION['gebruikersnaam']=$_POST['gebruikersnaam'];
$_SESSION['paswoord']=$_POST['paswoord'];
}
if ((isset($_POST['gebruikersnaam']))&&(isset($_POST['paswoord']))&&(isset($_POST['login']))){
header("Location: home.php");
}
?>
En dit is men login.php:
PHP Code:
<?php
require ('config.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><head>
<title>Welkom bij de Plaskesvrienden! - Log In!!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel=stylesheet type="text/css" href="site/styles.css">
</head>
<?php
require ('layout-up.php');
?>
<br />
<table class="style3" align="center">
<tbody>
<tr>
<td>
<form action="login.php" method="post">
Gebruikersnaam: <br /> <input type="text" name="gebruikersnaam" size="20" /><br />
Paswoord: <br /> <input type="password" name="paswoord" size="20" /> <br /><br />
<input value="Log In!" type="submit" name="login" />
</form>
</td>
</tr>
</tbody>
</table>
<br />
<?php
require ('layout-down.php');
?>
Dit is men layout-up.php:
PHP Code:
<table class="style1" align="center">
<tbody><tr>
<td width="642">
<img src="site/header.gif" alt="De Plaskesvrienden!">
</td>
<td>
<?php
if ((isset($_SESSION['gebruikersnaam']))&&(isset($_SESSION['paswoord']))){
print "Welkom!";
print "<br />";
print $_SESSION['gebruikersnaam'];
print "<br />";
print "<br />";
print '<a href="logout.php" target="_self">Log Out!</a>';
}else{
print '<a href="login.php" target="_self">Log In!</a>';
}
?>
</td>
</tr>
</tbody>
</table>
<br>
<table class="style2" align="center" cellspacing="0">
<tbody><tr>
<td width="20%"><a href="home.php">Home</a></td>
<td width="20%"><a href="kalender.php">De Kalender</a></td>
<td width="20%"><a href="forum.php">Forum</a></td>
<td width="20%"><a href="fotopagina.php">Fotopagina</a></td>
<td width="20%"><a href="wegbeschrijving.php">Wegbeschrijving</a></td>
</tr>
</tbody></table>
De werking kan je hier zien. Of beter de werking er niet van..