-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
38 lines (29 loc) · 837 Bytes
/
process.php
File metadata and controls
38 lines (29 loc) · 837 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
38
<?php
include'configure.php';
$error=''; //Variable to Store error message;
if(isset($_POST['submit'])){
if(empty($_POST['user']) || empty($_POST['pass'])){
$error = "Username or Password is Invalid";
}
else
{
//Define $user and $pass
$user=$_POST['user'];
$pass=$_POST['pass'];
//Establishing Connection with server by passing server_name, user_id and pass as a patameter
// $conn = mysqli_connect("localhost", "root", "");
// //Selecting Database
// $db = mysqli_select_db($conn, "userpass");
$query = mysqli_query($con, "SELECT * FROM users WHERE pass='$pass' AND user='$user'");
$rows = mysqli_num_rows($query);
if($rows == 1){
header("Location: dashboard.php"); // Redirecting to other page
}
else
{
$error = "Username of Password is Invalid";
}
mysqli_close($con); // Closing connection
}
}
?>