WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : How to query a directory server using LDAP. Keywords: ldap_connect ldap_search
Categories : LDAP, Network, PHP Update Picture
Nick Talbott
Date : Jul 10th 1998
Grade : 1 of 5 (graded 1 times)
Viewed : 16940
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Nick Talbott
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

LDAP query test

<?php

// basic sequence with LDAP is connect, bind, search, interpret search result,
close connection

echo "Connecting .. ";
$ds=ldap_connect("ds1.ruralwales.net");        // ! this must be a valid LDAP server !
echo "connect result is ".$ds."";

if ($ds)
        {
        echo "Binding ..";
        $r=ldap_bind($ds);        // this is an "anonymous" bind, typically read-
only access
        echo "Bind result is ".$r."";

        echo "Searching for (sn=A*) .."; // this example searches surname
entry
        $sr=ldap_search($ds,"o=Organisation Name, c=UK", "sn=A*"); // ! must
use real base dn here !
        echo "Search result is ".$sr."";

        echo "Number of entires returned is ".ldap_count_entries($ds,$sr)."";


        echo "Getting entries ...";
        $info = ldap_get_entries($ds, $sr);
        echo "Data for ".$info["count"]." items returned:";

        for ($i=0; $i<$info["count"]; $i++)
                {
                echo "";
                echo "dn is: ". $info[$i]["dn"] ."";
                echo "first cn entry is: ". $info[$i]["cn"][0] ."";
                echo "first email entry is: ". $info[$i]["mail"][0] ."";
                }

        echo "Closing connection";
        ldap_close($ds);
        }

else        {
        echo "Unable to connect to LDAP server";
        }



?>




Introduction to LDAP
Categories : LDAP, PHP
Function that returns an IP Address if it's correct. IMPROVED!!!
Categories : PHP, Algorithms, Network
Class that allows the PHP developer to establish connections with a POP3 mail server amd be able to list, retrieve and delete mail messages from a given mail box.
Categories : Network, Email, PHP, PHP Classes
redirect redirection ip address authentication authenticate addr
Categories : Authentication, HTTP, Network, PHP
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
base class to query the whois database
Categories : Network, PHP, PHP Classes
WebServerSpy checks which kind of Webserver is running, Apache, Netscape, Fasttrack, IIS, HTTP-Header, HTTP 1.0, GET, spy, WWW
Categories : HTTP, Network, Apache, PHP, Web Servers
PHP4 HTTP Compression Speeds up the Web
Categories : PHP, Zlib, HTML and PHP, HTTP, Network
Authentication script to authenticate users in Active Directory through LDAP.
Categories : LDAP, Authentication, Cookies, PHP
Windows 2003 Active Directory User Query (Ldap)
Categories : PHP, LDAP
Sample usage of IPv6 and IPv4 with PHP
Categories : PHP, PHP Classes, Network
Class for sending mail with MIME attachments in multipart format using external sendmail, mimencode and zip
Categories : Email, Network, PHP, PHP Classes
How to get the exit code and result of an exec() command.
Categories : PHP, Network
Client classes for Dictionary servers UPDATED: 2000-06-06
Categories : Network, Search, Complete Programs, PHP Classes, PHP
Examines the user's computer for open Netbus (the trojan horse) port and reports the conclusion to the user.
Categories : Network, PHP