-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.php
209 lines (158 loc) · 4.33 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
201
202
203
204
205
206
207
208
209
<?php ob_start();?>
<!DOCTYPE html>
<html>
<head>
<?php include 'bootstraparrangement.php';?>
<meta charset="UTF-8">
<title>BOOKERY | Signup</title>
<link href="style.css" rel="stylesheet"/>
<!-- <script src="jquery.js"></script> -->
<!-- <script src="jquery.min.js"></script> -->
<script src="jquery/jquery.min.js"></script>
</head>
<body>
<style>
* {box-sizing: border-box}
/* Add padding to containers */
.container {
padding: 16px;
}
/* Full-width input fields */
input[type=text], input[type=password],input[type=email] {
width: 100%;
padding: 15px;
margin: 5px 0 22px 0;
display: inline-block;
border: none;
background: #f1f1f1;
}
input[type=text]:focus, input[type=password]:focus, input[type=email]:focus {
background-color: #ddd;
outline: none;
}
/* Overwrite default styles of hr */
hr {
border: 1px solid #f1f1f1;
margin-bottom: 25px;
}
/* Set a style for the submit/register button */
.registerbtn {
background-color: #4CAF50;
color: white;
padding: 16px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
opacity: 0.9;
}
.registerbtn:hover {
opacity:1;
}
/* Add a blue text color to links */
a {
color: dodgerblue;
}
/* Set a grey background color and center the text of the "sign in" section */
.signin {
background-color: #f1f1f1;
text-align: center;
}
.alert {
padding: 20px;
background-color: #f44336;
color: white;
opacity: 1;
transition: opacity 0.9s;
margin-bottom: 15px;
border-radius: 9px;
width: 400px;
float: right;
position: relative;
}
.alert.success {background-color: #4CAF50;}
.alert.info {background-color: #2196F3;}
.alert.warning {background-color: #ff9800;}
.closebtn {
margin-left: 15px;
color: white;
font-weight: bold;
float: right;
font-size: 22px;
line-height: 20px;
cursor: pointer;
transition: 0.3s;
}
.closebtn:hover {
color: black;
}
</style>
<?php
include 'navbar.php';
include 'connection.php';
?>
<script>
function validateForm() {
var x = document.forms["myForm"]["name"].value;
if (x == "") {
alert("Name must be filled out");
return false;
}
}
</script>
<form id="submitform" class="was-validated" method="POST" enctype="multipart/form-data">
<div class="container">
<h1>Sign up</h1>
<p>Please fill in this form to create an account.</p>
<hr>
<label for="name"><b>FullName</b></label>
<input type="text" class="form-control" placeholder="Enter FullName" name="name" required />
<label for="email"><b>Email</b></label>
<input type="email" placeholder="Enter Email" name="email" required>
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<label for="psw-repeat"><b>Repeat Password</b></label>
<input type="password" placeholder="Repeat Password" name="psw-repeat" required>
<hr>
<div id="result"></div>
<p>By creating an account you agree to our <a href="#">Terms & Privacy</a>.</p>
<input type="submit" name="submit" id="submit" class="registerbtn">
</div>
<div class="container signin">
<p>Already have an account? <a href="login.php">Sign in</a>.</p>
</div>
</form>
<script>
</script>
<script type="text/javascript">
$(document).ready(function(){
$('#submit').click(function(e){
// e.preventDefault();
// .click('#submit');
$.ajax({
url: "post2.php",
type: "POST",
data: $('#submitform').serialize(),
success: function(response){
$("#result").html(response);
}
});
return false;
});
});
</script>
<script>
var close = document.getElementsByClassName("closebtn");
var i;
for (i = 0; i < close.length; i++) {
close[i].onclick = function(){
var div = this.parentElement;
div.style.opacity = "0";
setTimeout(function(){ div.style.display = "none"; }, 600);
}
}
</script>
<?php include 'footer.php';?>
</body>
</html>
<?php ob_end_flush();?>