php - My login form returns the same form after authentication,my LDAP connection is not working
I need to create a login page with login form with LDAP connection. After correct authentication user should be redirect to another profile page. For this purposes I have created two files.First one with the form and LDAP connection, the second one is re-directive page. In practice I feel the blanks and the same empty contact form appears. When I take a part of my code connected with LDAP on the after<?php get_header(); ?>
the login form is not visible on the page.
<?php get_header(); ?>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<div >
<div >
<div >
<h1 >Sign in to continue to Bootsnipp</h1>
<div >
<img src="https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=120"
alt="">
<form method="post">
<input type="text" placeholder="Email" required autofocus>
<input type="password" placeholder="Password" required>
<button type="submit">
Sign in</button>
<label >
<input type="checkbox" value="remember-me">
Remember me
</label>
<a href="#" >Need help? </a><span ></span>
</form>
</div>
<a href="#" >Create an account </a>
</div>
</div>
</div>
<?php
// active directory server
$ldap = ldap_connect("ldap://44.44.444");
//active directory DN (base location of ldap search)
$ldap = 'dc=itit,dc=local';
// configure ldap params
ldap_set_option($ldap,LDAP_OPT_PROTOCOL_VERSION,3);
ldap_set_option($ldap,LDAP_OPT_REFERRALS,0);
// user prefix
$ldap_usr_dom = "@itit.local";
// verify user and password
if($bind = @ldap_bind($ldap, $user.$ldap_usr_dom, $password)) {
echo success;
}else{
return false;
}
?>
<?php get_footer(); ?>
People are also looking for solutions of the problem: script cache:clear returned with error code 255
Source
Share
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.