-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebadmin.php
More file actions
28 lines (26 loc) · 789 Bytes
/
webadmin.php
File metadata and controls
28 lines (26 loc) · 789 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
<?php
session_start();
require 'dbconnect.php';
$name=$_POST['name'];
$result = $mysqli->query("SELECT * FROM webadmin WHERE username='$name'");
if ( $result->num_rows == 0 ){ // User doesn't exist
$_SESSION['message'] = "ENTERED WRONG USERNAME";
header("location: error.php");
}
else
{
$user = $result->fetch_assoc();
if (strcmp($_POST['pass'],$user['password'])==0){
// $_SESSION['email'] = $user['offemail'];
$_SESSION['name'] = $user['username'];
echo "<h2>HELLO</h2> ";
//$_SESSION['active'] = $user['active'];
$_SESSION['login'] = 1;
header("location: web_profile.php");
}
else{
$_SESSION['message'] = "You have entered wrong password, try again!";
header("location: error.php" );
}
}
?>