forked from katezach/FinalProjectPSPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcertify.php
29 lines (21 loc) · 810 Bytes
/
certify.php
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
<?php
session_start();
include('SQL_connection.php');
if (isset($_POST['log'])){
$username = $_POST['username'];
$_SESSION['user'] = $username;
$psw = $_POST['psw'];
$query = "SELECT * from accounts where Username='$username' and Mypassword='$psw' ";
$result = mysqli_query($link,$query);
$num = mysqli_num_rows($result);
if($num == 0){
echo '<script>alert("Login failed! Invalid username or password. Please try again !")</script>';
echo "<script> location.href='login.php'; </script>";
exit;
}else{
$_SESSION['logged'] = 1;
echo "<script> location.href='insidepage.php'; </script>";
}
mysqli_close($link);
}
?>