forked from cloudcomputingintelugu/ltibbhackathon
-
Notifications
You must be signed in to change notification settings - Fork 546
Expand file tree
/
Copy pathindexadmin.php
More file actions
58 lines (45 loc) · 1.62 KB
/
indexadmin.php
File metadata and controls
58 lines (45 loc) · 1.62 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
53
54
55
<?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 != ""){
$sql_query = "select count(*) as cntUser from admin 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: deletedata.php');
}else{
echo '<script type ="text/JavaScript">';
echo 'alert(" Wrong Username or Password ")';
echo '</script>';
}
}
}
?>
<html>
<head>
<title>Create simple login page with PHP and MySQL</title>
<link href="style2.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="container">
<form method="post" action="">
<div id="div_login">
<h1>Login</h1>
<div>
<input type="text" class="textbox" id="txt_uname" name="txt_uname" placeholder="Username" />
</div>
<div>
<input type="password" class="textbox" id="txt_uname" name="txt_pwd" placeholder="Password"/>
</div>
<div>
<input type="submit" value="Submit" name="but_submit" id="but_submit" />
</div>
</div>
</form>
</div>
</body>
</html>