-
Notifications
You must be signed in to change notification settings - Fork 0
/
babiescart.php
140 lines (120 loc) · 3.29 KB
/
babiescart.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php
$dbserver="localhost";
$user="root";
$pass="";
$db="test";
//$connect=mysqli_connect("localhost","root","","login");
$connect=mysqli_connect($dbserver,$user,$pass,$db);
//mysqli_select_db($connect,$db);
if(isset($_POST['username'])){
$username=$_POST['username'];
$password=$_POST['password'];
$username=mysqli_real_escape_string($connect,$username);
$password=mysqli_real_escape_string($connect,$password);
//$sql="select * from useregister where username='" .$username."AND password=' ".$password."' limit 1";
$result=mysqli_query($connect,"select * from user where username='$username' and password='$password'") or die("failed to query database ".mysqli_eror());
//$result=mysqli_query($connect,$sql);
$row=mysqli_fetch_array($result);
if($row['username']==$username && $row['password'==$password]){
echo "you have successfully logged ".$row['username'];
header('location:cart1.php');
}
else{
echo "you are not login";
}
}
/* $num=mysqli_num_rows($result);
if($num==n 1){
echo "you have successfully logged";
exit();
}
else{
echo "your are not loggedin";
exit();
}*/
?>
<!DOCTYPE <!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link rel="stylesheet" type="text/css" media="screen" href="webcss.css">
<script src="webpage.js"></script>
<style>
body{
background-image:url("img2.jpg");
width:100%;
height:100%;
position:fixed;
content:'';
background-position:center center;
background-repeat:no-repeat;
background-attachment:fixed;
background-size:cover;
}
.header{
background-color:brown;
height:80px;
margin:20px;
line-height: 35px;
text-align: center;
line-height:60px;
}
.frm{
border:solid black 5px;
width:600px;
border-radius:10px;
margin:100px auto;
background:#1456;
height:200px;
}
.textinput{
color:white;
background:#1456 ;
font:white;
padding:5px;
margin-left:70%;
}
body{
background-color:#1234;
}
</style>
</head>
<body>
<!--<div class="well">
<h4>Login</h4>
<form action="include/sign_in.php"method="post">
<div class ="input-group">
<input name="username" type="text" class="form-control" placeholder="Enter username">
<span class ="input-group-btn">
<button name="submit" class="btn btn-default" type="submit">
<span class="glyp"></span>
</button>
</span>
</div>
</form>
</div>-->
<div class ="header">
<h1><b> login to HASHLANKA </b></h1>
</div>
<form method="post" action="babiescart.php">
<div class="frm">
<tr>
<td><b>Username</b></td>
<td> <input type="text" name="username" class="textinput"></td>
</tr>
<tr>
<td><b>Password</b></td>
<td> <input type="password" name="password" class="textinput"></td>
</tr>
<!-- <tr>
<td>Confirm Password</td>
<td> <input type="password" name="password2" class="textinput"></td>
</tr>-->
<tr>
<td></td>
<td> <input type="submit" name="login" value="login"></td>
</tr>
</div>
</form>
</body>
</html>