Je moet ingelogd zijn om te stemmen.
<? session_start(); ob_start(); $user = "test"; $pass = "test"; if (@$_GET['action'] == "submit" ){ if(@$_POST['naam'] == $user && @$_POST['wachtwoord'] == $pass ){ $_SESSION['gebruiker'] = "admin"; Echo "U bent ingelogt ".@$_POST['naam']." "; } else{ Echo "Inloggen mislukt!"; } } if (@$_SESSION['gebruiker'] == "admin"){ header("location: admin.php"); } else { ?> <form method="post" action="index.php?action=submit"> Username: <input type="text" name="naam"><br> Wachtwoord: <input type="password" name="wachtwoord"> <input type="submit" name="submit" /><input type="reset" name"reset" /> </form> <? } ?>
<?session_start();ob_start();$user = "test";$pass = "test"; if (@$_GET['action'] == "submit" ){ if(@$_POST['naam'] == $user && @$_POST['wachtwoord'] == $pass ){ $_SESSION['gebruiker'] = "admin"; Echo "U bent ingelogt ".@$_POST['naam']." "; } else{ Echo "Inloggen mislukt!"; }}if (@$_SESSION['gebruiker'] == "admin"){ header("location: admin.php");}else {?> <form method="post" action="index.php?action=submit"> Username: <input type="text" name="naam"><br> Wachtwoord: <input type="password" name="wachtwoord"> <input type="submit" name="submit" /><input type="reset" name"reset" /> </form> <?}?>
<? if (@$_SESSION['gebruiker'] == "admin"){ echo "Je bent ingelogt"; } else { echo "Je hebt geen rechten hier"; } ?>
<?if (@$_SESSION['gebruiker'] == "admin"){ echo "Je bent ingelogt";} else { echo "Je hebt geen rechten hier";}?>