Created
December 20, 2017 15:00
-
-
Save philippebarbosa/2ff37ffb79e9b57c30afda030976c5ed to your computer and use it in GitHub Desktop.
Restricted page
This file contains hidden or 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
<?php ?> |
This file contains hidden or 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
var app = { | |
login: function() { | |
$("#site__login").submit(function(){ | |
var pin = $("#site__login__password").val().trim(); | |
if(pin != "" ){ | |
// alert(pin); | |
$.ajax({ | |
url: 'auth.php', | |
type: 'POST', | |
dataType: 'text', | |
data: {data : pin}, | |
success: function(response) | |
{ | |
console.log(response); | |
} | |
}); | |
} else { | |
alert('Le champs ne peut pas être vide !'); | |
} | |
}); | |
}, | |
init: function() { | |
app.login(); | |
} | |
}; | |
$(function() { | |
app.init(); | |
}); |
This file contains hidden or 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
<form action="<?php echo ($_SERVER['PHP_SELF']);?>" id="site__login"> | |
<label for="password">Mot de passe : </label> | |
<input id="site__login__password" name="password" type="password"> | |
<button type="submit" class="btn">Entrer</button> | |
</form> |
This file contains hidden or 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
Restricted content page |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment