HTML interesse |
|
Hallo,
op mijn index pagina moet je inloggen...
maar ik vul mijn gebruikersnaam en pass in...
En dan moet er komen Admin (of andere) is ingelogd.
Waar kan dat aan liggen.
<?php
ob_start();
//Hoe lang de bezoeker mag ingelogged blijven:
$expiredate = time()+60*60*24*7; //ingesteld op 1 week
if ($logout == 1)
{ setcookie("username");
setcookie("passgecodeerd");
header("location:index.php");
exit;
}
if ($_POST["username"] && $_POST["password"])
{ // password coderen
$passgecodeerd = md5($_POST["password"]);
$username = $_POST["username"];
// variabelen in een cookie zetten
setcookie("username",$username,$expiredate);
setcookie("passgecodeerd",$passgecodeerd,$expiredate);
header("location:$_SERVER[REQUEST_URI]");
exit;
}
$controle == FALSE;
$level = 1;
$jeid = "";
include ("login.php");
$controle = password($username, $passgecodeerd);
if ($controle == TRUE)
{ $query = "SELECT * FROM members where id='$jeid'";
$resultaat = mysql_query($query) or die (mysql_error());
while ($obj = mysql_fetch_object($resultaat))
{ $nickname ="$obj->nickname";
$jeid="$obj->id";
$level="$obj->level";
}
include ('config.php');
}
if ($_POST['Login'] && $controle == TRUE)
echo "Je bent succesvol ingelogged";
elseif ($_POST['Login'] && $controle != TRUE)
echo "Fout wachtwoord en/of gebruikersnaam";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 ...>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=...">
<title>Login</title>
</head>
<body>
<?php
if ($controle != TRUE)
{ ?><form method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td>Username:</td></tr>
<tr><td><input type="text" name="username"></td></tr>
<tr><td>Password:</td></tr>
<tr><td><input type="password" name="password"></td></tr>
<tr><td><input type="submit" value="Login" name="Login"></td></tr>
</table>
</form>
<?php
} elseif ($controle == TRUE) {
echo "Welkom $jenickname";
} ?>
</body>
</html>
<?php //Hoe lang de bezoeker mag ingelogged blijven: $expiredate = time()+60*60*24*7; //ingesteld op 1 week if ($logout == 1) } if ($_POST["username"] && $_POST["password"]) { // password coderen $passgecodeerd = md5($_POST["password"]); $username = $_POST["username"]; // variabelen in een cookie zetten setcookie("passgecodeerd",$passgecodeerd,$expiredate); header("location:$_SERVER[REQUEST_URI]"); } $controle == FALSE; $level = 1; $jeid = ""; include ("login.php"); $controle = password($username, $passgecodeerd); if ($controle == TRUE) { $query = "SELECT * FROM members where id='$jeid'"; { $nickname ="$obj->nickname"; $jeid="$obj->id"; $level="$obj->level"; } include ('config.php'); } if ($_POST['Login'] && $controle == TRUE) echo "Je bent succesvol ingelogged"; elseif ($_POST['Login'] && $controle != TRUE) echo "Fout wachtwoord en/of gebruikersnaam"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 ...> <html> <head> <meta http-equiv="content-type" content="text/html; charset=..."> <title>Login</title> </head> <body> <?php if ($controle != TRUE) { ?><form method="post" action=""> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr><td>Username:</td></tr> <tr><td><input type="text" name="username"></td></tr> <tr><td>Password:</td></tr> <tr><td><input type="password" name="password"></td></tr> <tr><td><input type="submit" value="Login" name="Login"></td></tr> </table> </form> <?php } elseif ($controle == TRUE) { echo "Welkom $jenickname"; } ?> </body> </html>
|