-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatus.php
22 lines (22 loc) · 880 Bytes
/
status.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
session_start();
if(isset($_POST['Login'])){
$name=$_POST['name'];
$password=$_POST['pwd'];
$con=mysqli_connect("localhost","root","");
mysqli_select_db($con,"mydb");
$result=mysqli_query($con,"select * from user_info where name='$name' and password='$password'");
if(mysqli_num_rows($result)){
$_SESSION['name']=$name;
echo "Successfully Logged in!";
echo "<br><br><form action='start.php' method='get'><input type='submit' value='Take the test' name='start'></form>";
echo "<form action='logout.php' method='get'><input type='submit' value='Logout' name='logout' style='margin-left:0.5rem'></form>";
}
else
echo "User not registered!<br><br><a href='login.htm'>Redirect to Login page</a>";
mysqli_close($con);
}
else
header("Location:login.htm");
?>
<link rel="stylesheet" type="text/css" href="table.css">