-
Notifications
You must be signed in to change notification settings - Fork 9
/
adminlogin.php
61 lines (52 loc) · 1.73 KB
/
adminlogin.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
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
56
57
58
59
60
<?php
include("sqlcon.php");
session_start();
error_reporting(0);
if(isset($_POST[login]))
{
$rs = mysqli_query($con,"select * from tbladmin where emailid=".$_POST[adminname]." and apassword=".$_POST[password]." ");
if(mysqli_num_rows($rs) > 0)
{
$result = mysqli_fetch_array($rs);
$_SESSION[uid] = $result[0];
$_SESSION[name] = $result[1];
$_SESSION[type] = "admin";
echo "<script>window.location=index.php;</script>";
}
else
echo "<script>alert(Invalid credential!!!!!);</script>";
}
/* ### */ ?>
<?php
include("header.php")
/* ### */ ?>
<div class="container">
<div class="page">
<h3 align="center" >Login</h3>
<div class="bs-example" data-example-id="simple-horizontal-form">
<form action="" method="post" class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label" style="text-align:right;">User Name</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="adminname" name="adminname" placeholder="Username" required>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label" style="text-align:right;">Password</label>
<div class="col-sm-4">
<input type="password" class="form-control" id="password" name="password" placeholder="Password" required>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-8" style="text-align:center;">
<input type="submit" name="login" value="LOGIN" class="btn btn-default"/>
<input type="reset" name="cancel" value="CANCEL" class="btn btn-default"/>
</div>
</div>
</form>
</div>
</div>
</div>
<?php
include("footer.php")
/* ### */ ?>