PHP
  Home arrow PHP arrow Adding Methods to the Query Processor ...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Adding Methods to the Query Processor in PHP
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 8
    2006-05-24

    Table of Contents:
  • Adding Methods to the Query Processor in PHP
  • Reviewing previous PHP networking functions: a quick look at the "QueryProcessor" class
  • Adding more functionality to the "QueryProcessor" class: defining the "Ping()" and "IpConfig()" methods
  • More methods ahead: defining the "Netstat()" and "getMXRecordsWin()" methods
  • Gluing the pieces together: listing the full source code of the "QueryProcessor" class

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Adding Methods to the Query Processor in PHP


    (Page 1 of 5 )

    Over this second article in a series covering network programming in PHP, you will learn how to run popular Windows network monitoring utilities, such as the “ping,” “netstat” and “ipconfig” programs, by adding some new methods to the “QueryProcessor” class introduced in the previous article.

    Introduction

    Want to learn more about the basics of network programming in PHP? Look no further. Welcome to the second part of the series "Network Programming in PHP." This set of three tutorials teaches how to use numerous networking PHP built-in functions in a practical way, in order to build a query processor in PHP 5, which can be used to perform some of the most common network operations.

    As usual, I'd like to step back for a moment to the previous article of the series, and refresh your memory of some of the topics that I explored in that tutorial. In this way, you'll be able to pick up the flow of the concepts that I'll deploy in the next few lines, without needing to reread the prior article.

    As you'll probably recall, in the first part of the series, I went through the basics of using many native PHP functions included in its networking library, and started constructing an extensible query processor class in PHP 5. During this coding experience, you hopefully learned how convert host names to their corresponding IP addresses and vice versa, how to find the number of a given TCP port that is used by a specific service, and how to list the services in conjunction with their corresponding port numbers.

    Even though most of these tasks can be considered trivial operations, they should be taken into account as an introductory and educational exercise, useful for tackling more complex PHP projects that require the implementation of advanced network programming routines. This might eventually include working with low-level sockets, handling DNS records, reading and writing socket streams, and so forth.

    Right, at this point I guess that all the networking PHP built-in functions that I covered in the first article, such as the "gethostbyaddr()", "gethostbyname()", "gethostbynamel()" functions are already familiar to you. So now I will explain what new things you'll learn in this second article of the series. Since I want to continue expanding the "QueryProcessor" class that I coded previously, this installment will focus on adding more methods to it, by using other useful PHP network functions, aimed particularly at running popular Windows networking applications, like "ipconfig," "netstat" and more.

    Having established the goals for this article, let's move on and see how the "QueryProcessor" class can be expanded by aggregating more network-based methods. Let's get started.

    More PHP Articles
    More By Alejandro Gervasio


       · In this second article of the series, you'll see how to add more methods to the...
     

       

    PHP ARTICLES

    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT