-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregistration.php
More file actions
196 lines (164 loc) · 4.91 KB
/
registration.php
File metadata and controls
196 lines (164 loc) · 4.91 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
<?php
include_once 'db_connection.php';
$sql = "SELECT Email FROM Users";
$email_check = $conn->query($sql);
$isTakenG = false;
$name = $email = "";
$nameErrG = $emailErrG = "";
$countOfSuccesfulFieldsG = 0;
$isTakenF = false;
$name = $pass = $email = "";
$nameErrF = $emailErrF = $passErrF = "";
$countOfSuccesfulFieldsF = 0;
session_start();
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
if(!empty($_POST["Full"]))
{
include 'registration_functionality.php';
}
elseif(!empty($_POST["Guest"]))
{
include 'registrationGuest.php';
}
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="registration.css">
</head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.7.0/css/all.css' integrity='sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ' crossorigin='anonymous'>
<body>
<img src="homePageLogo.png" class="logo">
<div class="topnav">
<a href="index.php" style="color:white"><i class="fa fa-fw fa-home">
</i>Home</a>
<a href="registration.php" class="active" style="color:white"><i class="fa fa-key"></i>Registration</a>
<a href="registerInstitution.php" style="color:white"><i class="fa fa-key"></i>Register an institution</a>
<a href="account.php" style="color:white"><i class="fa fa-fw fa-user"></i>Account</a>
<a href="institutions.php" style="color:white"><i class="fa fa-fw fa-globe"></i>Search Places</a>
<a href="items.php" style="color:white"><i class="fa fa-fw fa-search"></i>Search Items</a>
<a href="found.php" style="color:white"><i class="fas fa-hand-holding-heart"></i>Found Something</a>
</div>
<div class="gridContainer">
<div class="gridItem">
<h1><legend align="center"><b>Register as a guest</b></legend></h1>
<br>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<?php
if(empty($nameErrG))
{
?>
<span class="error">*</span>
<label>Name</label>
<?php
}
else
{
?>
<span class="error">* <?php echo $nameErrG;?> </span>
<?php
}
?>
<input type="text" name="name" placeholder="Your name.." required>
<?php
if(empty($emailErrG))
{
?>
<span class="error">*</span>
<label>Email</label>
<?php
}
else
{
?>
<span class="error">* <?php echo $emailErrG;?> </span>
<?php
}
?>
<input type="text" name="email" placeholder="Your email.." required>
<label class="termsAndCond">I have read and agree to the
<a href="terms.html"> Terms and conditions</a> and the
<a href="privacy.html"> Privacy Policy.</a>
<input type="checkbox" required>
<span class="checkmark"></span>
</label>
<input class="buttons" type="submit" value="Register" name="Guest">
</form>
</div>
<div class="gridItem">
<h1><legend align="center"><b>Register</b></legend></h1>
<br>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<?php
if(empty($nameErrF))
{
?>
<span class="error">*</span>
<label>Name</label>
<?php
}
else
{
?>
<span class="error">* <?php echo $nameErrF;?> </span>
<?php
}
?>
<input type="text" name="name" placeholder="Your name.." required>
<?php
if(empty($emailErrF))
{
?>
<span class="error">*</span>
<label>Email</label>
<?php
}
else
{
?>
<span class="error">* <?php echo $emailErrF;?> </span>
<?php
}
?>
<input type="text" name="email" placeholder="Your email.." required>
<?php
if(empty($passErrF))
{
?>
<span class="error">*</span>
<label>Password</label>
<?php
}
else
{
?>
<span class="error">* <?php echo $passErrF;?> </span>
<?php
}
?>
<input type="password" name="pass" placeholder="Your password.." required>
<span class="error">*</span>
<label>Repeat Password</label>
<input type="password" name="pass2" placeholder="Confirm password.." required>
<label class="termsAndCond">I have read and agree to the
<a href="terms.html"> Terms and conditions</a> and the
<a href="privacy.html"> Privacy Policy.</a>
<input type="checkbox" required>
<span class="checkmark"></span>
</label>
<input class="buttons" type="submit" value="Register" name="Full">
</form>
</div>
</div>
</body>
</html>