-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignUp.php
More file actions
115 lines (92 loc) · 2.31 KB
/
signUp.php
File metadata and controls
115 lines (92 loc) · 2.31 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
<?php
session_start();
?>
<!doctype html>
<html lang="en">
<head>
<title>printpuppy</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.js"></script>
<script type="text/javascript" src="resources/jquery/jquery.validate.js"></script>
<script type="text/javascript" src="resources/jquery/jquery.form.js"></script>
<script type="text/javascript" src="resources/jquery/jquery.simplemodal-1.4.1.js"></script>
<script type="text/javascript">
function ajaxResponseHandler(response, status)
{
$('#response').html(response.message)
$('#response').modal({
modal: false,
escClose: true
});
if (response.status_code == 200)
setTimeout('window.location = "index.php";', 2000);
else
setTimeout('$("#response").css("display", "none");', 2000);
}
$(document).ready(function() {
var validator = $('#signup_form').validate({
// submit action
submitHandler: function(form) {
$(form).ajaxSubmit({
dataType: 'json',
success: ajaxResponseHandler
});
return false;
},
// error messages
errorPlacement: function(error, element) {
error.appendTo(element.prev());
},
// rules
rules: {
email: {
required: true,
email: true
},
password1: {
required: true
},
password2: {
required: true,
equalTo: '#password1'
}
},
// error messages
messages: {
email: {
required: 'Email is required!',
email: 'Invalid email address!'
},
password1: {
required: 'Password is required!'
},
password2: {
required: 'Password is required!',
equalTo: 'Passwords must match!'
}
}
});
});
</script>
</head>
<body>
<div id="response"></div>
<div id="container">
<h1>Sign Up</h1>
<form name="signup_form" id="signup_form" method="post" action="signupRequest.php">
<label>email address:</label>
<input type="text" name="email" id="email" />
<br />
<label>password:</label>
<input type="text" name="password1" id="password1" />
<br />
<label>re-enter password:</label>
<input type="text" name="password2" id="password2" />
<br />
<input type="submit" value="submit" />
</form>
<hr />
<a href="index.php">Print</a>
</div>
</body>
</html>