Skip to content

Instantly share code, notes, and snippets.

@mohamedmansour
Created March 24, 2012 00:35
Show Gist options
  • Save mohamedmansour/2176758 to your computer and use it in GitHub Desktop.
Save mohamedmansour/2176758 to your computer and use it in GitHub Desktop.
Testing LDAP in PHP
<?php
$ds = @ldap_connect(ldap_host);
if ($ds) {
$r = @ldap_bind($ds, 'mmansour@DOMAIN', 'bad');
if ($r) {
echo "Success";
}
else {
echo "Failed";
}
ldap_close($ds);
} else {
echo "Unable to connect to LDAP server";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment