-
Notifications
You must be signed in to change notification settings - Fork 0
/
register.php
141 lines (137 loc) · 7.66 KB
/
register.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
<?php
session_start();
if (isset($_SESSION['user_id'])) {
header("Location: http://localhost/friendalize/");
exit();
}
if (!isset($register_message)) {
$username = "";
$firstname = "";
$lastname = "";
$register_email = "";
$age = "";
}
require_once('includes/connection.php');
require_once('includes/functions.php');
$countries_array = get_countries($db);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include("includes/head.php"); ?>
<title>Account Registration | Friendalize</title>
<link href="styles/register.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<div class="navbar-fixed-top">
<a href="signin.php"><div id="logo"><img src="images/logos/white_transparent.png" alt="Friendalize Logo">friendalize</div></a>
</div>
</div>
<div class="container">
<h1>Account Registration</h1>
<h2>Step 1: Enter Your Personal Info</h2>
<div class="progress">
<div class="progress-bar progress-bar-active" role="progressbar" aria-valuenow="33.3"
aria-valuemin="0" aria-valuemax="100" style="width:33.3%">
Personal Info
</div>
<div class="progress-bar progress-bar-inactive" role="progressbar" aria-valuenow="33.3"
aria-valuemin="0" aria-valuemax="100" style="width:33.3%">
Institution
</div>
<div class="progress-bar progress-bar-inactive" role="progressbar" aria-valuenow="33.4"
aria-valuemin="0" aria-valuemax="100" style="width:33.4%">
Get Started
</div>
</div>
<h4>To become a <span>Friendalizer</span>, these following details are required.<br>Please fill in the form below to proceed...</h4>
<?php
if (isset($register_message)) {
echo "<div id='message'>" . $register_message . "</div>";
}
?>
<form class="form-horizontal" action="register-p.php" method="post">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="control-label col-sm-4" for="username">Username:</label>
<div class="col-sm-8">
<input class="form-control form-input" type="text" id="username" name="username" placeholder="Enter your username" value="<?php echo $username; ?>" required autofocus>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="first_name">First Name:</label>
<div class="col-sm-8">
<input class="form-control form-input" type="text" id="first_name" name="first_name" placeholder="Enter your first name" value="<?php echo $firstname; ?>" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="last_name">Last Name:</label>
<div class="col-sm-8">
<input class="form-control form-input" type="text" id="last_name" name="last_name" placeholder="Enter your last name" value="<?php echo $lastname; ?>" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="password">Password:</label>
<div class="col-sm-8">
<input class="form-control form-input" type="password" id="password" name="password" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" placeholder="Enter your password" title="Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="password_confirm">Confirm Password:</label>
<div class="col-sm-8">
<input class="form-control form-input" type="password" id="password_confirm" name="password_confirm" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" placeholder="Confirm your password" required>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="control-label col-sm-4" for="email">Email:</label>
<div class="col-sm-8">
<input class="form-control form-input" type="email" id="email" name="email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$" placeholder="Enter your email address" value="<?php echo $register_email; ?>" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="age">Age:</label>
<div class="col-sm-8">
<input class="form-control form-input" type="number" id="age" name="age" placeholder="Enter your age" value="<?php echo $age; ?>" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="gender">Gender:</label>
<div class="col-sm-8">
<select class="form-control form-select" id="gender" name="gender" required>
<option value="" selected="selected">Select your gender</option>
<option value="1">Male</option>
<option value="2">Female</option>
<option value="3">Other</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="country">Country:</label>
<div class="col-sm-8">
<select class="form-control form-select" id="country" name="country" required>
<option value="" selected="selected">Select your country</option>
<?php foreach ($countries_array as $countries) : ?>
<option value="<?php echo $countries['country_id']; ?>"><?php echo htmlspecialchars($countries['name']); ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button class="btn btn-submit" type="submit">Continue<i class="fa fa-chevron-right" aria-hidden="true"></i></button>
</div>
</div>
</form>
</div>
<footer>
<p>© <?php echo date("Y"); ?> All Rights Reserved by LEAF.</p>
<p>Terms & Conditions | Privacy Policy</p>
</footer>
</body>
</html>