-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.php
More file actions
144 lines (133 loc) · 5.05 KB
/
signup.php
File metadata and controls
144 lines (133 loc) · 5.05 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
<?php
if(isset($_POST["signuponlogin"])){
if(isset($_POST["email"])&&isset($_POST["pwd1"])&&isset($_POST["pwd2"])){
if($_POST["pwd1"] == $_POST["pwd2"]){
$email = $_POST["email"];
$pwd = $_POST["pwd1"];
}else{
header('Location: login.php?msg=Passwords%20do%20not%20match&type=danger&ch2=1');
}
}else{
header('Location: login.php?msg=Please%20fill%20all%20fields&type=danger&ch2=1');
}
}else{
header('Location: login.php?msg=Enter%20your%20email%20please&type=info&ch2=1');
}
if(isset($_POST["signup"])){
if(isset($_POST["email"])&&isset($_POST["pwd"])&&isset($_POST["firstName"])&&isset($_POST["lastName"])&&isset($_POST["birth"])&&isset($_POST["address"])&&isset($_POST["city"])&&isset($_POST["state"])&&isset($_POST["zip"])&&isset($_POST["number"])){
if(filter_var($_POST["email"], FILTER_VALIDATE_EMAIL)){
header('Location: profile.php?msg=Welcome%20!&type=success');
}else{
header('Location: login.php?msg=Please%20fill%20all%20fields&type=danger&ch2=1');
}
}else{
header('Location: login.php?msg=Please%20fill%20all%20fields&type=danger&ch2=1');
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include ('head.html'); ?>
<!-- Title website -->
<title>Signup - Hoppy</title>
</head>
<body>
<div style="background:transparent !important;" class="jumbotron">
<div class="container text-center">
<h1 class="display-3">Hoppy Learning</h1>
</div>
</div>
<?php include ('nav.php'); ?>
<div class="container">
<div class="page-header">
<h3>Create Account</h3>
<div class="dropdown-divider"></div>
</div><br>
<?php echo $msg; ?>
<br>
<div class="row justify-content-center">
<div class="col-sm col-5">
<form class="form-horizontal">
<div class="form-group">
<!-- First Name & Last Name -->
<div class="row">
<div class="col">
<label for="exampleInputPassword1">First Name</label>
<input type="password" class="form-control form-control-sm" id="exampleInputPassword1" placeholder="" name="firstName">
</div>
<div class="col">
<label for="exampleInputPassword1">Last Name</label>
<input type="password" class="form-control form-control-sm" id="exampleInputPassword1" placeholder="" name="lastName">
</div>
</div>
</div>
<!-- Adress -->
<div class="form-group">
<label for="inputAddress">Address</label>
<input type="text" class="form-control form-control-sm" id="inputAddress" placeholder="201 Avenue Charles De Gaulle" name="address">
</div>
<div class="form-group">
<!-- City, State & Zip Code -->
<div class="row">
<div class="col-7">
<label for="inputCity">City</label>
<input type="text" class="form-control form-control-sm" id="inputCity" name="city">
</div>
<div class="col">
<label for="inputState">State</label>
<select id="inputState" class="form-control form-control-sm" name="state">
<option selected>Choose...</option>
<option>France</option>
</select>
</div>
<div class="col">
<label for="inputZip">Zip Code</label>
<input type="text" class="form-control form-control-sm" id="inputZip" name="zip">
</div>
</div>
</div>
<div class="form-group">
<!-- Date of Birth & Cellphone number -->
<div class="row">
<div class="col-7">
<label for="inputCity">Date of Birth</label>
<input type="date" id="birthDate" class="form-control form-control-sm" name="birth">
</div>
<div class="col">
<label for="inputState">Cellphone Number</label>
<input type="text" class="form-control form-control-sm" id="inputZip" name="number">
</div>
</div>
</div>
<!-- Email & Password for account -->
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control form-control-sm" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email" name="email" value="<?php echo $email;?>">
<small id="emailHelp" class="form-text text-muted">Your e-mail will be the id account</small>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<?php
if($pwd != '' && $pwd != null){
echo '<br>';
for($i=0;$i<strlen($pwd);$i++){
echo '*';
}
echo '<br><input type="hidden" name="pwd">';
}else{
echo '<input type="password" class="form-control form-control-sm" id="exampleInputPassword1" placeholder="Password" name="pwd">
<small id="passwordHelpInline" class="text-muted">
Must be 8-20 characters long.
</small>';
}
?>
</div>
<button type="submit" class="btn btn-primary btn-sm" name="signup">Submit</button>
</form>
</div>
</div>
</div><br><br>
<?php include ('footer.html'); ?>
</body>
</html>