Jump to content

Troubleshooting User Login Error


jshenn

Recommended Posts

We are using a multi-user PHP login system (Simple,Secure PHP) on our website.  It has been working perfectly for several years.  Recently we added one new user who is having trouble.  His account works fine on his work computer but generates a php error on his home computer.  I am able to login with his account, no problem.  We've created a new account and even tried re-purposing an existing account, all with the same results.

The error message on the web page is coming from this code:
```
     $('#login').click(function(){
        if($('input#username').val() == "" || $('input#password').val() == "")
        {
            $('#feedback').removeClass().addClass('error').text('Please enter a username and 
            password!').fadeIn();
            return false;
        }
        else
        {
            $('#loading').fadeIn();
            $('#feedback').hide();
            
            $.ajax
            ({
                type: 'POST',
                url: 'process.php',
                dataType: 'json',
                data:
                {
                    username: $('input#username').val(),
                    password: $('input#password').val()
                },
                success:function(data)
                {
                    $('#loading').hide();
                    $('#feedback').removeClass().addClass((data.error === true) ? 
                    'error':'success').text(data.message).fadeIn();
                    if(data.error === true)
                    {
                        // $('#memberLoginForm').fadeOut();
                    }
                    else
                    {
                        $('#memberLoginForm').fadeOut();
                        $('#footer').fadeOut();
                        $('.link').fadeIn();
                        location.href = 'protected.php';
                    }
                },
                error:function(XMLHttpRequest,textStatus,errorThrown)
                {
                    $('#loading').fadeOut();
                    $('#feedback').removeClass().fadeIn().addClass('error').text('I\'m sorry but a php 
                    error triggered this, check your php log file for more information');
                }
            });
            return false;
        }
    });     
```

This code is working for 99.9% of our users and even works for the problem user when he is on another pc.

Looking for some advise on how to further troubleshoot this?  It seems to be a problem specific to his pc.  He has taken the pc to a repair shop and they point back to the website.  His home pc is running Windows 7.

I've looked at the php error log on our web server just after a failed attempt and I am not seeing an error message logged.

Link to comment
Share on other sites

The so-called "PHP error" only means that when the browser tried to send the login data to process.php the server responded with some sort of error. Could be so, so many different things going wrong, only some of which are to do with PHP.

There's not much you can do unless you can reproduce the problem yourself, or find something in your PHP or server error log.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.