-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathadmin_1.php
More file actions
37 lines (24 loc) · 782 Bytes
/
admin_1.php
File metadata and controls
37 lines (24 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
session_start();
include("include/conn.php");
if( isset($_POST['login']) && isset($_POST['Password']) && !empty($_POST['Password'])){
//$Username= $_POST['Username'];
$Password=$_POST['Password'];
$query= "SELECT password FROM admin WHERE username='sohaib' AND password='$Password' ";
$result=mysqli_query($conn , $query);
$count=mysqli_num_rows($result);
if($count==1)
{
//$_SESSION['Username'] = $Username;
$_SESSION['Password'] = $Password;
$_SESSION['login'] = true;
//echo "<script>alert('you are logged in')</script>";
echo "<script>window.open('employeslist.php' , '_self')</script>";
}
else
{
echo "<script>alert('incorrect username or password')</script>";
echo "<script>window.open('index.php' , '_self')</script>";
}
}
?>