-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
52 lines (44 loc) · 1.61 KB
/
Copy pathindex.php
File metadata and controls
52 lines (44 loc) · 1.61 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
include "config.php";
if(isset($_POST['but_submit'])){
$uname = mysqli_real_escape_string($con,$_POST['txt_uname']);
$password = mysqli_real_escape_string($con,$_POST['txt_pwd']);
if ($uname != "" && $password != "")
{
$password = md5($password);
$sql_query = "select count(*) as cntUser from users where username='".$uname."' and password='".$password."'";
$result = mysqli_query($con,$sql_query);
$row = mysqli_fetch_array($result);
$count = $row['cntUser'];
if($count > 0){
$_SESSION['uname'] = $uname;
header('Location: home.php');
}else{
echo "Invalid username and password";
}
}
}
?>
<html>
<head>
<meta charset="utf-8">
<title>InRythm</title>
<link rel="stylesheet" href="formstyle.css">
</head>
<body>
<div class="box">
<h2>Login</h2>
<form action="" method="post">
<div class="inputBox">
<input type="text" id="txt_uname" name="txt_uname" required="">
<label>username</label>
</div>
<div class="inputBox">
<input type="password" id="txt_uname" name="txt_pwd" required="">
<label>password</label>
</div>
<input type="submit" id="but_submit" name="but_submit" value="Submit"> <a href="signin.php" style="color: aliceblue">Dont have an account? </a>
</form>
</div>
</body>
</html>