forked from harshjoeyit/ExpendiShare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
78 lines (74 loc) · 2.77 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
<?php
session_start();
// Note: The session_start() function must be the very first thing in your document. Before any HTML tags.
if(isset($_SESSION['user'])) {
header('Location: ./dashboard.php'); // change for .htaccess
}
if(isset($_SESSION['user'])) {
ob_start();
}
$title = "Sign Up | ExpendiShare";
include_once('components/header.php');
?>
<div class="container">
<form>
<section class="form">
<p style="color: orange">page not reloading after succesfull signup</p>
<div class="form-field">
<label>Username</label>
<input name="username" type="text" style="text-transform:lowercase" max-length="40" required>
<p id="username-check-message" class="error"></p>
<!-- <p id="demo" class="error"></p> -->
</div>
<div class="form-field">
<label>Name</label>
<input name="name" type="text" max-length="50" required>
<p id="name-check-message" class="error"></p>
</div>
<div class="form-field">
<label>Email</label>
<input name="email" type="email" max-length="50" required>
<p id="email-check-message" class="error"></p>
</div>
<div class="form-field">
<label>Password</label>
<input name="password" type="password" required>
<p id="password-check-message" class="error"></p>
</div>
<p id="register-response-message" class="error"></p>
<div>
<button id="make-account" class = "btn">Sign Up</button>
</div>
<br>
<div><a href="login.php">Have an account?</a></div>
</section>
</form>
</div>
<script src="./js/signup.js"></script>
<script>
$(document).ready(function() {
$('.form-field > input').on('keyup', function(e) {
if(e.which == 13)
return;
$(this).next().removeClass("error");
// next() - for selecting the next element
$(this).next().css("display", "none");
});
$('input[name="username"]').on("keyup", function() {
var username = $('input[name="username"]').val();
// console.log(username);
checkUsernameAvailability(username);
});
$("#make-account").on('click', function() {
checkFieldsIfBlank();
var username = $('input[name = "username"]').val();
var name = $('input[name = "name"]').val();
var email = $('input[name = "email"]').val();
var password = $('input[name = "password"]').val();
makeAccount(username, name, email, password);
});
});
</script>
<?php
include_once('components/footer.php');
?>