Error in Jquery targeting

Asked

Viewed 51 times

0

I am using the following code so that after the login and password it is directed to the respective page. Locally it works, but when I go up to the server, it’s giving Chrome error:

ERR_TOO_MANY_REDIRECTS

And in Firefox:

This problem may be caused by disabling or refusing to accept cookies.

As I said earlier, locally it works perfectly. The code I’m using for redirect is:

<script type="text/javascript">
$(document).ready(function(){
   $('#login-form').submit(function() {
     data = $('#login-form').serialize();
     $.post("validar.php",{
            d: data,
     },
      function (d) {
        console.log(d);
       if(d == 1){
           $('#myModal').modal('show');
        }else{
         var redirecionar = "sistema/";
        $(window.document.location).attr('href',redirecionar);
        }
      });
      return false;
    });
});
</script>

It is worth remembering that the directory system/ exists.

  • And there’s some page index in that directory ?

  • Hello Isac. Yes you have.

  • Strange... when I tried to access the phpmyadmin by the server, is giving this error: Error During Session start; Please check your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser. session_start(): open(SESSION_FILE, O_RDWR) failed: No such file or directory (2)

  • I’m sorry if this error is from the server, but I need to have this security to have arguments to go to them.

  • What are the permissions of this directory on the server?

  • I can not inform you, because it is a hosting that I am using. It worked and accessed quietly. The server is not local, but remote.

  • phpmyadmin is back, but the error shown in the code continues.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.