"; //force the browser to use ssl (STRONGLY RECOMMENDED!!!!!!!!) #if ($_SERVER["SERVER_PORT"]!=443){ header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); exit(); } //you should look into using PECL filter or some form of filtering here for POST variables $username=strtoupper($_POST["username"]); //remove case sensitivity on the username $password=$_POST["password"]; $formage=$_POST["formage"]; if ($_POST["oldform"]){ //prevent null bind if ($username!=NULL && $password!=NULL){ //include the class and create a connection include ("../adLDAP.php"); try { $adldap = new adLDAP(); } catch (adLDAPException $e) { echo $e; exit(); } //authenticate the user if ($adldap -> authenticate($username,$password)){ //establish your session and redirect session_start(); $_SESSION["username"]=$username; $redir="Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/menu.htm"; header($redir); exit; } } $failed=1; } ?> adLDAP example This area is restricted.
Please login to continue.
Username:
Password:


Login Failed!

\n"); } ?>
You have successfully logged out."); } ?>