Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php include("header.php");
- if(!empty($_SESSION['name']))
- {
- header("location: index.php");
- }
- session_destroy();
- session_start();
- if(!empty($_POST['submit']))
- {
- if(!empty($_POST['naam']) && !empty($_POST['wachtwoord']))
- {
- $results = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE name = '".$_POST['naam']."'"));
- if($results['name']!="")
- {
- if($results['pass']==md5($_POST['wachtwoord']))
- {
- $_SESSION['id'] = $results['id'];
- $_SESSION['name'] = $results['name'];
- $_SESSION['pass'] = $results['pass'];
- header("location: index.php");
- }
- else $fout = "Wachtwoord is foutief.";
- }
- else $fout = "Naam bestaat niet.";
- }
- else $fout = "je hebt niet alles ingevuld!";
- }
- ?>
- <form method="post" action="login.php">
- <table cellspacing="1" width="850px" id="inhoud_table">
- <tr><th colspan="2">Inloggen</th></tr>
- <?php if(!empty($fout)) Echo "<tr><td colspan=\"2\" class=\"table_register_fail\">".$fout."</td></tr>"; ?>
- <tr><td class="table_category"><b>Gebruikersnaam:</b></td><td class="table_register"><input type="text" name="naam" size="30" maxlength="40" ></td></tr>
- <tr><td class="table_category"><b>Wachtwoord:</b></td><td class="table_register"><input type="password" name="wachtwoord" size="30" maxlength="40" ></td></tr>
- <tr><td class="table_category" colspan="2"><center><INPUT TYPE="submit" name="submit" VALUE=" Inloggen "></center></td></tr>
- </table>
- </form>
- <?php include("footer.html"); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement