Dont want display Warning: ldap_bind() but my own error message

Posted on 2010-01-05
Last Modified: 2013-12-13
hi all,
I hope i is simple one for some of you who know it :).
I am trying to bind to ad using php ldap manual, problem is that when the ldap_bind() failes it throws a warning message even if I say somthing like
$bd = ldap_bind($ad,$username,$password)
or die("couldn't bind to ad");
It would give the Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Invalid credentials in..
before the message i have types.
All I am after is that how to not display the warning message and do the action I have set it to.

Question by:SameerMirza

    Accepted Solution

    I am getting good... It pretty simple
    Some one give the ponts!!
    //Disable error messages

    Expert Comment

    error_reporting('E_ALL & ~E_WARNING');

    Author Comment

    how about winding them all up as I posted above

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
    Part of the Global Positioning System A geocode ( is the major subset of a GPS coordinate (, the other parts being the altitude and t…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now