Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'db.php';
- //informatie uit verzenden opvragen
- $username = $_POST['username'];
- $pw = $_POST['password'];
- $password = sha1($pw);
- //table
- $table = "users";
- //Sql injectie tegengaan
- $username = stripslashes($username);
- $password = stripslashes($password);
- $username = mysql_real_escape_string($username);
- $password = mysql_real_escape_string($password);
- $sql="SELECT * FROM $tbl_name WHERE username='$username' and password='$password'";
- $result=mysql_query($sql);
- $count=mysql_num_rows($result);
- //als er resultaat is
- if($count==1){
- session_register("username");
- session_register("password");
- header("location:overview.php");
- }
- else {
- header("Location: login.php");
- }
- ?>
Add Comment
Please, Sign In to add comment