Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#sublogin').click(function(){
- var user = $('#login').val();
- var pass = $('#password').val();
- //if($.trim(user).length > 0 && $.trim(pass).length > 0){
- $.ajax({
- url:"consulta.php",
- method:"POST",
- data:{user:user, pass:pass},
- cache:"false",
- beforeSend:function() {
- $('#sublogin').val("Conectando...");
- },
- success:function(data) {
- $('#sublogin').val("Log in");
- if (data=="1") {
- //$(location).attr('href','index.php');
- header("location:index.php");
- }
- else{
- alert("Usuuario y contraseña incorrectos.");
- }
- }
- });
- //}
- });
- $numero_registro=$resultado->rowCount();
- if($numero_registro!=0){
- $_SESSION["user"]=$_POST["user"];
- echo "1";
- }
- else{
- echo "error";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement