-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.html
More file actions
105 lines (89 loc) · 4.57 KB
/
Copy pathsignup.html
File metadata and controls
105 lines (89 loc) · 4.57 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Sign Up - cisciqc</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/login.css" rel="stylesheet">
</head>
<body class="text-center">
<nav class="navbar navbar-dark fixed-top bg-dark p-0 shadow">
<a class="navbar-brand col-sm-3 col-md-2 mr-0" href="index.html">cisciqc</a>
<ul class="navbar-nav px-3">
<li class="nav-item"> <!-- class="nav-link" -->
<a href="instuctions.php" style='padding-right: 10px;color: rgba(255, 255, 255, .5);'>Instructions</a>
<a href="login.html" style='padding-right: 10px;color: rgba(255, 255, 255, .5);'>Sign In</a>
<a href="signup.html" style='padding-right: 10px;color: rgba(255, 255, 255, .5);'>Sign Up</a>
</li>
</ul>
</nav>
<form class="form-signin" id='registerForm' style="margin-top: 75px">
<h1 class="h3 mb-3 mt-4 font-weight-normal">Create an account</h1>
<label for="inputEmail" class="sr-only">Email address</label>
<input type="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
<label for="inputEmailconf" class="sr-only">Email address</label>
<input type="email" id="inputEmailconf" class="form-control" placeholder="Confirm your Email address" required >
<label for="inputPassword" class="sr-only">Password</label>
<input type="password" id="inputPassword" class="form-control" placeholder="Password" required >
<label for="inputPasswordconf" class="sr-only">Password</label>
<input type="password" id="inputPasswordconf" class="form-control" placeholder="Confirm your Password" required >
<div class="form-group mt-1">
<label for="expertise">What's your level of expertise with X data? <a href='instructions.html' target="_blank">How to define your level of expertise</a></label>
<select class="form-control" id="expertise">
<option>Beginner</option>
<option>Intermediate</option>
<option>Expert</option>
</select>
</div>
<div class="checkbox mb-3 mt-2">
<label>
<input type="checkbox" value="agreeEULA" id='legalStuff'> I have read and understood the instructions and purposes of the experiment and I give my informed consent to the collection of the data and to the publication for academic research purposes, as described in our <a href='privacy.html'target='_blank'>Privacy Policy</a>
</label>
</div>
<button class="btn btn-primary btn-block" type='submit'>Sign in</button>
<p class="mt-2 mb-3">Already have an account? <a href="login.html">Sign In!</a></p>
<p class="mt-5 mb-3 text-muted">© 2019</p>
</form>
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
$("#registerForm").submit(function() {
var email1 = document.getElementById('inputEmail').value;
var email2 = document.getElementById('inputEmailconf').value;
if(email1 != email2){
alert("The two email adresses do not match.")
return(0);
}
var pwd1 = document.getElementById('inputPassword').value;
var pwd2 = document.getElementById('inputPasswordconf').value;
if(email1 != email2){
alert("The two passwords do not match.");
return(0);
}
var privacyAccepted = document.getElementById('legalStuff').checked;
console.log(privacyAccepted);
if(!privacyAccepted){
alert('Please accept the legal stuff.');
return(0);
}
//Se fino a qui e' andato tutto bene passo i dati (via POST) al file PHP che effettua le verifiche
$.post("app/functions/register.php", { email: $('#inputEmail').val(), password: $('#inputPassword').val(), expertise: $('#expertise').val(), rand: Math.random() }, function(response) {
// se i dati sono corretti...
if (response == 1) {
alert("Account created, you can now log in");
document.location = 'login.html';
}else{
// stampo un messaggio di errore
alert(response);
}
});
// evito il submit del form (che deve essere gestito solo dalla funzione Javascript)
return false;
});
</script>
</body>
</html>