Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 701215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:35:06+00:00 2026-05-14T03:35:06+00:00

I am using this tutorial to create a login form http://www.ryancoughlin.com/2008/11/04/use-jquery-to-submit-form/ It authenticates against

  • 0

I am using this tutorial to create a login form http://www.ryancoughlin.com/2008/11/04/use-jquery-to-submit-form/

It authenticates against w/ our ldap server.

What I am having a problem with is the line

success: function(){
 $('form#submit').hide(function(){$('div.success').fadeIn();});

It runs success even though we don’t even know if the username and password binded successfully.

Is there a way to only run success if the username and password posted was binded successfully?

EDIT:

Added php code of ldap-login.php

<?php

ini_set('display_errors',1);
error_reporting(E_ALL);
require_once('/web/ee_web/include/adLDAP.php');
$adldap = new adLDAP();
if (isset($_POST['username']) && isset($_POST['password'])) {
    $username = $_POST['username'];
    $password = $_POST['password'];  // associated password

    // connect to ldap server
    $authUser = $adldap->authenticate($username, $password);
    if ($authUser === true) {
        $_SESSION['user_session'] = $username;
        if(isset($_SESSION['user_session'])) {
            print "ok";
        }   
    }
    else {
      print "User authentication unsuccessful";
    }
}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:35:06+00:00Added an answer on May 14, 2026 at 3:35 am

    If your response comes back having a simple string “ok” or the error message, you can check it this way:

    success: function(data){
      if(data === "ok") {
        $('form#submit').hide(function(){$('div.success').fadeIn();
      } else {
        alert(data); // If not "ok", show error message
      }
    });
    

    Alternatively, send/check a more complex JSON response.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have used this tutorial http://net.tutsplus.com/tutorials/javascript-ajax/submit-a-form-without-page-refresh-using-jquery/ to create php - jquery - ajax
I am trying to implement reset password functionality using the tutorial at http://www.binarylogic.com/2008/11/16/tutorial-reset-passwords-with-authlogic/ and
Ok, so i created a very simple splash screen using this tutorial: http://p-xr.com/android-tutorial-how-to-make-a-basic-splash-screen/ The
I followed this tutorial to create a sample Login application using ASP.NET MVC I
I'm using this tutorial to add a Login Item to my application. Most of
I built a Jquery dropdown menu using this tutorial . It works across browsers
I've been using this tutorial to rewrite my login/logout functionality to handle authentication and
I'm trying to create a game loop using this tutorial . I have tried
Using this tutorial at section 5.5, I attempted to Assign the 'celsius' string attribute
I am using this tutorial to try to replace the default TitleBar with a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.