-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
88 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
<?php if (isset($_SESSION['wrong_email']) && $_SESSION['wrong_email']): ?> | ||
<?php $_SESSION['wrong_email'] = false ?> | ||
<div class="alert alert-warning alert-dismissible fade show" role="alert"> | ||
<strong>Holy guacamole!</strong> You should check in on some of those fields below. | ||
<strong>Attenzione!</strong> La mail inserita non corrisponde a nessun account. | ||
<button type="button" class="close" data-dismiss="alert" aria-label="Close" onclick="$('.alert').alert()"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<?php endif; ?> | ||
<?php if (isset($_SESSION['wrong_password']) && $_SESSION['wrong_password']): ?> | ||
<?php $_SESSION['wrong_password'] = false ?> | ||
<b>Attenzione</b> La passowrd non è corretta. | ||
<div class="alert alert-danger alert-dismissible fade show" role="alert"> | ||
<strong>Attenzione!</strong> La password inserita non è corretta. | ||
<button type="button" class="close" data-dismiss="alert" aria-label="Close" onclick="$('.alert').alert()"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<?php endif; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
include "../connection.php"; | ||
|
||
$email = $_GET['email']; | ||
|
||
$q['utente'] = count(query("SELECT * FROM utenti WHERE email='$email'")); | ||
|
||
echo json_encode($q); | ||
|
||
?> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
include '../connection.php'; | ||
if ($_SERVER['REQUEST_METHOD'] == 'POST'){ | ||
print_r($_POST); | ||
$nome = $_POST['nome']; | ||
$cognome = $_POST['cognome']; | ||
$email = $_POST['email']; | ||
$password = $_POST['password']; | ||
|
||
query("INSERT INTO utenti (`nome`, `cognome`, `email`, `password`) VALUES ('$nome', '$cognome', '$email', SHA('$password'))"); | ||
|
||
header("Location: ../accedi/?email=$email"); | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
var error = $('#error'); | ||
error.hide(); | ||
|
||
var controlEmail = function(email){ | ||
$.getJSON('../queries/existEmail.php?email='+email).done(function(e){ | ||
if (e['utente']){ | ||
error.show(); | ||
$(':input[type="submit"]').prop('disabled', true); | ||
$(':input[type="password"]').prop('disabled', true); | ||
} else { | ||
error.hide(); | ||
$(':input[type="submit"]').prop('disabled', false); | ||
$(':input[type="password"]').prop('disabled', false); | ||
} | ||
}); | ||
} | ||
|
||
|
||
$('#inputPassword, #confirmPassword').on('keyup', function () { | ||
if ($('#inputPassword').val() == $('#confirmPassword').val()) { | ||
$('#errorPassword').hide(); | ||
$(':input[type="submit"]').prop('disabled', false); | ||
$(':input[type="email"]').prop('disabled', false); | ||
} else{ | ||
$('#errorPassword').show(); | ||
$(':input[type="submit"]').prop('disabled', true); | ||
$(':input[type="email"]').prop('disabled', true); | ||
} | ||
}); |