-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregis.php
More file actions
271 lines (250 loc) · 6.98 KB
/
regis.php
File metadata and controls
271 lines (250 loc) · 6.98 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
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<?php
include("header.php");
include("connect.php");
?>
<script type="text/javascript">
function validation()
{
var v=/^[A-Za-z ]+$/;
if(form1.txtname.value=="")
{
alert("Please Enter Your Name");
form1.txtname.focus();
return false;
}else{
if(!v.test(form1.txtname.value))
{
alert("Please Enter Only Alphabets in Your Name");
form1.txtname.focus();
return false;
}
}
if(form1.txtadd.value=="")
{
alert("Please Enter Your Address");
form1.txtadd.focus();
return false;
}
if(form1.txtcity.value=="")
{
alert("Please Enter Your City Name");
form1.txtcity.focus();
return false;
}else{
if(!v.test(form1.txtcity.value))
{
alert("Please Enter Only Alphabets in Your City Name");
form1.txtcity.focus();
return false;
}
}
var v=/^[0-9]+$/;
if(form1.txtmno.value=="")
{
alert("Please Enter Your Mobile No");
form1.txtmno.focus();
return false;
}else if(form1.txtmno.value.length!=10)
{
alert("Please Enter Your Mobile No 10 Digit Long");
form1.txtmno.focus();
return false;
}
else{
if(!v.test(form1.txtmno.value))
{
alert("Please Enter Only Digits in Your Mobile No");
form1.txtmno.focus();
return false;
}
}
var v=/^[A-Za-z0-9.-_]+@[A-Za-z0-9.-_]+\.([a-zA-Z]{2,4})+$/;
if(form1.txtemail.value=="")
{
alert("Please Enter Your Email ID");
form1.txtemail.focus();
return false;
}else{
if(!v.test(form1.txtemail.value))
{
alert("Please Enter Valid Email ID");
form1.txtemail.focus();
return false;
}
}
if(form1.txtpwd.value=="")
{
alert("Please Enter Your Password");
form1.txtpwd.focus();
return false;
}else if(form1.txtpwd.value.length<6)
{
alert("Please Enter Your Password More Than 6 Character");
form1.txtpwd.focus();
return false;
}else if(form1.txtpwd.value.length>10)
{
alert("Please Enter Your Password Less Than 10 Character");
form1.txtpwd.focus();
return false;
}
if(form1.selutype.value=="0")
{
alert("Please Select User Type");
form1.selutype.focus();
return false;
}
if(form1.gender[0].checked==false)
{
if(form1.gender[1].checked==false)
{
alert("Please Select Gender");
return false;
}
}
}
</script>
<?php
if(isset($_POST['btnregis']))
{
$name=$_POST['txtname'];
$add=$_POST['txtadd'];
$city=$_POST['txtcity'];
$mno=$_POST['txtmno'];
$email=$_POST['txtemail'];
$pwd=$_POST['txtpwd'];
$utype=$_POST['selutype'];
$gender=$_POST['gender'];
$res1=mysql_query("select * from user_regis where email_id='$email'");
if(mysql_num_rows($res1)>0)
{
echo "<script type='text/javascript'>";
echo "alert('Email Id Already Exists');";
echo "window.location.href='regis.php';";
echo "</script>";
}else{
//auto no code start...
$res2=mysql_query("select max(user_id) from user_regis");
$uid=0;
while($r2=mysql_fetch_array($res2))
{
$uid=$r2[0];
}
$uid++;
//auto no. code end...
$query="insert into user_regis values('$uid','$name','$add','$city','$mno','$gender','$email','$pwd','$utype')";
if(mysql_query($query))
{
echo "<script type='text/javascript'>";
echo "alert('Registration Successfully');";
echo "window.location.href='login.php';";
echo "</script>";
}
}
}
?>
<!-- Start About -->
<div class="about-section-box">
<br/><br/><br/>
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="heading-title text-center">
<h2>REGISTRATION</h2>
<p>Real cooking is more about following your heart than following recipes.</p>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<img src="images/regis2.gif" alt="" style="width:100%; height:100%;">
</div>
<div class="col-lg-6 col-md-6 col-sm-12 text-center">
<div class="inner-column">
<div class="col-md-12">
<form name="form1" method="post">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<input type="text" class="form-control" name="txtname" placeholder="Your Name">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<textarea class="form-control" placeholder="Your Address" name="txtadd" rows="3" ></textarea>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<input type="text" class="form-control" name="txtcity" placeholder="Your City Name">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<input type="text" class="form-control" name="txtmno" placeholder="Your Mobile No">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<input type="text" placeholder="Your Email" class="form-control" name="txtemail" >
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<input type="password" placeholder="Your Password" class="form-control" name="txtpwd" >
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<select class="custom-select d-block form-control" name="selutype">
<option value="0">Select User Type</option>
<option value="1">USER</option>
<option value="2">VLOGGER</option>
</select>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-12">
<div class="form-group" style="text-align: left;">
Select Gender
<input type="radio" name="gender" value="MALE"> MALE
<input type="radio" name="gender" value="FEMALE"> FEMALE
</div>
</div>
<div class="col-md-12">
<div class="submit-button text-center">
<button class="btn btn-common" name="btnregis" type="submit" onclick="return validation();">REGISTER</button>
<div id="msgSubmit" class="h3 text-center hidden"></div>
<div class="clearfix"></div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End About -->
<!-- Start QT -->
<div class="qt-box qt-background">
<div class="container">
<div class="row">
<div class="col-md-8 ml-auto mr-auto text-left">
<p class="lead ">
"Cooking demands attention, patience, and above all, a respect for the gifts of the earth. It is a form of worship, a way of giving thanks"
</p>
<span class="lead">Judith B. Jones</span>
</div>
</div>
</div>
</div>
<!-- End QT -->
<?php
include("footer.php");
?>