Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'database.php';
- session_start();
- $username=mysql_real_escape_string($_POST['username']);
- $password=mysql_real_escape_string($_POST['password']);
- $bool=true;
- $query=mysql_query("SELECT * FROM employee WHERE username='$username'");
- $exists=mysql_num_rows($query);
- $table_employee="";
- $table_password="";
- if($exists>0)
- {
- while($row=mysql_fetch_assoc($query))
- {
- $table_employee=$row['username'];
- $table_password=$row['password'];
- }
- if(($username==$table_employee)&&($password==$table_password))
- {
- if($password==$table_password)
- {
- $_SESSION['username']=$username;
- header("location: /technician/index.php");
- }
- }
- else
- {
- Print'<script>alert("Incorrect Username or Password!");</script>';
- Print'<script>window.location.assign("login.php");</script>';
- }
- }
- ?>
Add Comment
Please, Sign In to add comment