-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
36 lines (27 loc) · 714 Bytes
/
process.php
File metadata and controls
36 lines (27 loc) · 714 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
<?php
session_start();
// form data received
$username = $_REQUEST['username'];
$password = md5($_REQUEST['password']);
include('dbConnect.php');
$sql = "select * from admin where username=:username";
$stmt = $pdo->prepare($sql);
$stmt->bindParam(":username",$username);
$stmt->execute();
if($stmt->rowCount()>0){
$row = $stmt->fetch();
if($row['password']==$password){
$_SESSION['aid'] = $row['aid'];
$_SESSION['admin_id'] = $username;
$_SESSION['aname'] = $row['aname'];
header("location:admin_dashboard.php");
}else{
$_SESSION['error'] = "Wrong Password";
header("location:admin_login.php");
}
}else
{
$_SESSION['error'] = "Wrong User ID";
header("location:admin_login.php");
}
?>