-
Notifications
You must be signed in to change notification settings - Fork 3
/
signup.php
200 lines (174 loc) · 5.38 KB
/
signup.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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<?php
session_start();
require_once("dbconnect.php");
if(isset($_POST['Signup'])){
$email = $_POST['email'];
$pass = $_POST['pass'];
$fn =$_POST['fname'];
$ln =$_POST['lname'];
$phn =$_POST['phone'];
$add =$_POST['address'];
$dob =$_POST['DOB'];
//cus id maker//
$cq = "select count(*) as y from customers";
$r1 = mysqli_query($connection, $cq);
$res1 = mysqli_fetch_all($r1, MYSQLI_ASSOC);
$res2 = $res1[0]['y'];
$cusID = 'C'.(1001+$res2);
//cus id maker//
$q = "INSERT into users values('$cusID', '$email','$pass','CUS')";
$qq = "INSERT into customers values('$cusID', '$fn', '$ln','$phn', '$email','$dob','$add')";
$q1 = "select count(*) as x from users where email='$email'";
$r1 = mysqli_query($connection, $q1);
$res1 = mysqli_fetch_all($r1, MYSQLI_ASSOC);
$res2 = $res1[0]['x'];
if ($res2>0){
echo '<script>';
echo 'alert("YOU ALREADY HAVE AN ACCOUNT")';
echo '</script>';
}else{
$exec = mysqli_query($connection, $q);
$exec2= mysqli_query($connection, $qq);
echo '<script>';
echo 'alert("Welcome to Quickeats")';
echo '</script>';
header("Location: login.php");
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<nav>
<div class=" logo">Quickeats</div>
<div class="nav-items">
<a href="Home.php">HOME</a>
<a href="aboutus.php">ABOUT</a>
<a href="login.php">LOGIN</a>
</div>
</nav>
<section class= "front">
<div class=heading><h1 style="text-align: center; color: #265073;">Signup</h1></div>
<div class="front-container">
<div class= mid-container>
<!-- the form starts here -->
<form class = 'frm' method="post" action="signup.php">
<label for="Fname"><b>First Name</b></label>
<input type="text" placeholder="Enter First Name" name="fname" required>
<!-- <br> -->
<label for="lname"><b>Last Name</b></label>
<input type="text" placeholder="Enter Last Name" name="lname" required>
<br>
<label for="phone"><b>Phone</b></label>
<input type="text" placeholder="Enter Phone Number" name="phone" required>
<br>
<label for="email"><b>Email</b></label>
<input type="text" placeholder="Enter Email" name="email" required>
<br>
<label for="address"><b>address</b></label>
<input type="text" placeholder="Enter Your Address" name="address" required>
<br>
<label for="bday"><b>Date of Birth</b></label>
<input type="text" placeholder="Enter Date of Birth" name="DOB" required>
<br>
<label for="password"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="pass" required>
<br>
<button class='butt' type="submit" name="Signup">Signup</button>
</form>
</div>
</div>
</section>
<style>
*{
box-sizing: border-box;
margin: 0;
padding: 0;
font-family:'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
nav {
height: 50px;
background: #265073;
display:flex ;
justify-content: space-between;
align-items: center;
padding: 0rem calc((100vw -1300px) / 2);
}
.logo {
color: #ECF4D6;
font-size: 1.7rem;
font-weight: bold;
font-style: italic;
padding: 0 2rem;
}
nav a {
text-decoration: none;
font-size: 1.2rem;
color: #9AD0C2;
padding: 0 1.5rem;
}
nav a:hover {
color: #ECF4D6;
}
.front {
background: #ECF4D6;
}
.heading{
text-align: center;
font-size: 1.7rem;
color:265073;
}
.front-container {
margin-left: 2rem;
display:flex ;
grid-template-columns: 1fr 1fr ;
height:95vh ;
padding: 3rem calc((100vw -1300px) / 2);
justify-content:center ;
align-items: center ;
}
.mid-container{
display: flex;
justify-content:center ;
padding: 16px;
align-items: center ;
height: 600px;
width:350px;
background-color: #265073;
color:#ECF4D6;
font-size: 1rem;
margin-top: -3rem;
}
.frm{
align-items: center ;
justify-content:center ;
}
input[type=text], input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;}
.butt {
padding: 1rem 3rem ;
border: none;
color: #265073;
background: #ECF4D6;
cursor:pointer ;
border-radius: 50px;
margin-left:5.5rem;
font-size:1rem;
}
button:hover{
background: #fff;
color: #265073;
}
</style>
</body>
</html>