Jump to content

PHP login page

Recommended Posts

//prevent default php processing
//collect user inputs
    var datatopost = $(this).serializeArray();
//send them to login.php using AJAX
        url: 'login.php',
        type: "POST",
        data: datatopost,
        success: function(data){
            if(data == "success"){
            $("#loginmessage").html('<div class="alert alert-danger">There was an error with the Ajax Call. Please try again later1.</div>');

Share this post

Link to post
Share on other sites

Have you checked the calls' headers and responses in the network tab of your browser's developer tools?

Share this post

Link to post
Share on other sites

There are 5 parts to an ajax call

  • generating the call (which you have shown us)
  • The headers sent to the server
  • the processing on the server
  • the response returned
  • the processing of the response (also shown)

All of those need to be correct.

Share this post

Link to post
Share on other sites

Join the conversation

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

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.