note 41429 added to function.ldap-connect

From: Date: Fri, 09 Apr 2004 18:12:00 +0000
Subject: note 41429 added to function.ldap-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-67905@lists.php.net to get a copy of this message
Like the user above, I'm getting a resource ID returned under all circumstances - even when the server doesn't exist, so I'm using ldap_error to check that a connection has been established with the server. $ldap=ldap_connect('hostname'); $myLdap=@ldap_bind($ldap,'CN='.$username.',CN=SBS',$password); if(ldap_error($ldap)=="Can't contact LDAP server") { $this->auth=false; $this->code=-1; $this->message='Connection to LDAP server failed.'; } ---- Manual Page -- http://www.php.net/manual/en/function.ldap-connect.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41429 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41429&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41429&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#67905) next »