Skip to content

Instantly share code, notes, and snippets.

@koconder
koconder / ldap.php
Last active September 4, 2022 23:09
LDAP Login Autentication and Search in PHP, no Class required PHP 5+
<?php
//Error Checking
error_reporting(E_ALL);
ini_set('display_errors', '1');
//Set User domain extention
$LDAPUserDomain = "@my.domain"; //Needs the @, but not always the same as the LDAP server domain
?><form name="input" action="ldap.php" method="post">
Username: <input type="text" name="u"> <?php echo $LDAPUserDomain;?><br />
Password: <input type="password" name="p">