Skip to content

Instantly share code, notes, and snippets.

@yainakrub
Created April 22, 2017 05:17
Show Gist options
  • Save yainakrub/37897a0c5367b46c9c409956bee89090 to your computer and use it in GitHub Desktop.
Save yainakrub/37897a0c5367b46c9c409956bee89090 to your computer and use it in GitHub Desktop.
LDAP
<?php
$ldap_dn = "cn=read-only-admin,dc=example,dc=com";
$ldap_password = "password";
$ldap_con = ldap_connect("ldap.forumsys.com");
ldap_set_option($ldap_con, LDAP_OPT_PROTOCOL_VERSION, 3);
if(ldap_bind($ldap_con, $ldap_dn, $ldap_password)) {
echo "Bind successful!";
} else {
echo "Invalid user/pass or other errors!";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment