forked from yatin2410/ToDoWebApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathf.php
179 lines (133 loc) · 3.26 KB
/
f.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
error_reporting(0);
include('conn.php');
if(isset($_REQUEST['submit']))
{
$user = $_REQUEST['user'];
$pass = $_REQUEST['pass'];
$lgn= "select * from reg where user='$user' ";
$reg= $conn->query($lgn);
$chk= $reg->num_rows;
if($chk==0)
{
$sq ="insert into reg (user,pass) values ('$user','$pass')";
$reg= $conn->query($sq);
if($reg)
{
?>
<script type="text/javascript">
alert('insert success');
window.location ="login.php";
</script>
<?PHP
}
else
{
?>
<script type="text/javascript">
alert('insert not succes');
window.location ="f.php";
</script>
<?PHP
}
}
else
{
?>
<script type="text/javascript">
alert('username already exist');
window.location ="f.php";
</script>
<?PHP
}
}
?>
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.first_div{
background-color: #3190D3;
color: white;
border-radius: 15px;
margin-top:11%;
margin-left: 24%;
width: 50%;
height: 100%;
align-items: center;
padding: 120px;
}
#loser_pass{
width:
}
</style>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<title>sign up here</title>
</head>
<body>
<!--
<form method="POST">
<table>
<tr>
<td>
Username:
</td>
<td>
<input type="text" name="user" >
</td>
</tr>
<tr>
<td>
password:
</td>
<td>
<input type="password" name="pass">
</td>
</tr>
<tr>
<td>
<input type="submit" name="submit" value="submit">
</td>
</tr>
</table>
</form>
-->
<div class="first_div" margin="">
<form class="form-horizontal" method="POST">
<div class="form-group">
<label for="inputUsername3" class="col-sm-2 control-label">Username</label>
<div class="col-sm-10" id="loser_pass">
<input type="text" name="user" class="form-control" id="inputUsername3" placeholder="enter your username">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">Password</label>
<div class="col-sm-10" id="loser_pass">
<input type="password" name="pass" class="form-control" id="inputPassword3" placeholder="Password">
</div>
</div>
<!-- <div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox"> Remember me
</label>
</div>
</div>
</div> -->
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default" name="submit" value="submit" >
submit</button>
</div>
</div>
</form>
</div>
</center>
</body>
</html>