Onbekend |
|
<?
session_start();
include("config.php");
function checkopleeg(){
if(!empty($_POST['username'])) AND ereg('/^[0-9a-zA-Z]+$/',$_POST['username']) AND !empty($_POST['password'])) return true;
return false;
}
function check_exists($gebruikersnaam,$password){
$aCount = mysql_query("SELECT COUNT(*) FROM leden WHERE username = '".$gebruikersnaam."' AND password = '".$password."'") or die(mysql_error());
$bCount = mysql_result($aCount,0);
if($bCount == 1) return true;
return false;
}
if(isset($_POST['login'])){
if(checkopleeg() AND check_exists($_POST['username'],$_POST['password'])){
echo "Succesvol ingelogd!";
$_SESSION['ingelogd'] = true;
}
else echo "Verkeerde gegevens";
}
else{
?>
<form method='post'>USER: <input type='text' name='username'><br />PASS: <input type='password' name='password'><br /><input type='submit' name='login'></form>
<?
}
?>
<? include("config.php"); function checkopleeg(){ if(!empty($_POST['username'])) AND ereg('/^[0-9a-zA-Z]+$/',$_POST['username']) AND !empty($_POST['password'])) return true; return false; } function check_exists($gebruikersnaam,$password){ $aCount = mysql_query("SELECT COUNT(*) FROM leden WHERE username = '".$gebruikersnaam."' AND password = '".$password."'") or die(mysql_error()); if($bCount == 1) return true; return false; } if(isset($_POST['login'])){ if(checkopleeg() AND check_exists($_POST['username'],$_POST['password'])){ echo "Succesvol ingelogd!"; $_SESSION['ingelogd'] = true; } else echo "Verkeerde gegevens"; } else{ ?> <form method='post'>USER: <input type='text' name='username'><br />PASS: <input type='password' name='password'><br /><input type='submit' name='login'></form> <? } ?>
|