-
Notifications
You must be signed in to change notification settings - Fork 0
/
success.php
76 lines (61 loc) · 1.91 KB
/
success.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php include('header.php'); ?>
<?php include('navbar.php'); ?>
<?php include('dbcon.php');
?>
<div class="container">
<div class="margin-top">
<div class="row">
<div class="span12">
<img src="img/dr.jpg">
<hr>
</div>
<div class="span12">
<div class="alert alert-success">You are successfully registered, you can now login your Account</div>
<div class="login">
<div class="alert alert-info"><strong>Please Enter the Details Below..</strong></div>
<form method="post" class="form-horizontal">
<div class="control-group">
<label class="control-label" for="inputPassword">Username</label>
<div class="controls">
<input type="text" name="username" placeholder="Username" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="inputPassword">Password</label>
<div class="controls">
<input type="password" name="password" placeholder="Password" required>
</div>
</div>
<div class="control-group">
<div class="controls">
<button name="submit" type="submit" class="btn btn-info"><i class="icon-signin icon-large"></i> Sign Up</button>
</div>
</div>
</form>
<?php
if (isset($_POST['submit'])){
$username = $_POST['username'];
$password = $_POST['password'];
$query = "SELECT * FROM members WHERE username='$username' AND password='$password'";
$result = mysqli_query($conn,$query)or die(mysqli_error($conn));
$num_row = mysqli_num_rows($result);
$row=mysqli_fetch_array($result);
if( $num_row > 0 ) {
$_SESSION['id']=$row['member_id']; ?>
<script>
window.location="dasboard.php";
</script>
<?php
}
else{ ?>
<div class="alert alert-danger"><strong>Please Check your username and password..</strong></div>
<?php
}
}
?>
</div>
</div>
</div>
</div>
</div>
<?php /* include('footer.php'); */ ?>