scripts:
config.php
<?php
define('DB_HOST', 'localhost');
define('DB_USER', 'xxxx');
define('DB_PASSWORD', 'xxxx');
define('DB_DATABASE', 'test_lra');
?>
auth.php
<?php
//Start session
session_start();
//Check whether the session variable SESS_MEMBER_ID is present or not
if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) == '')) {
header("location: access-denied.php");
exit();
}
?>login-exec.php
<?php
//Start session
session_start();
//Check whether the session variable SESS_MEMBER_ID is present or not
if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) == '')) {
header("location: access-denied.php");
exit();
}
?>
login-form.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Login Form</title>
<link href="loginmodule.css" rel="stylesheet" type="text/css" />
</head>
<body>
<p> </p>
<form id="loginForm" name="loginForm" method="post" action="login-exec.php">
<table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td width="112"><b>Gebruikersnaam</b></td>
<td width="188"><input name="login" type="text" class="textfield" id="login" /></td>
</tr>
<tr>
<td><b>Wachtwoord</b></td>
<td><input name="password" type="password" class="textfield" id="password" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Login" /></td>
</tr>
</table>
</form>
</body>
</html>
member-index.php
<?php
require_once('auth.php');
ini_set('display_errors', 'On');
error_reporting(E_ALL);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Member Index</title>
<link href="loginmodule.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
if $_SESSION['SESS_GRAAD'] == 3 { ?>
<h1>Welkom <?php echo $_SESSION['SESS_FIRST_NAME']; ?></h1><br/>U bent ingelogd!<br/><br/>
<a href="meestern.php">Klik hier om op de meesterpagina te komen!</a>
<?php
}
elseif $_SESSION['SESS_GRAAD'] == 2 { ?>
<h1>Welkom <?php echo $_SESSION['SESS_FIRST_NAME']; ?></h1><br/>U bent ingelogd!<br/><br/>
<a href="gezeln.php">Klik hier om op de gezellenpagina te komen!</a>
<?php
}
elseif $_SESSION['SESS_GRAAD'] == 1 { ?>
<h1>Welkom <?php echo $_SESSION['SESS_FIRST_NAME']; ?></h1><br/>U bent ingelogd!<br/><br/>
<a href="leerlingn.php">Klik hier om op de leerlingpagina te komen!</a>
<?php
}
?>
</body>
</html>
Dit geeft dus een serverfout 500. waarom volgens mij is er niets fout.
Gaarne uw hulp.
met vriendelijke groet Jacques Jansen