PHP Classes

File: index_whois.php

Recommend this page to a friend!
  Classes of Schroetter Christian   PHP Ping Traceroute and DNS   index_whois.php   Download  
File: index_whois.php
Role: Example script
Content type: text/plain
Description: Whois example
Class: PHP Ping Traceroute and DNS
Send ping and traceroute ICMP request messages
Author: By
Last change:
Date: 9 years ago
Size: 577 bytes
 

Contents

Class file image Download
<?php
   
include_once('./ping.class.php');

    function
PrintUsage($string = '')
    {
        if(
$string != '') {
            echo
$string . "\n\n";
        }

        echo
'php index_whois.php [addr]' . "\n";
        echo
"\t" . '[addr]: The domain to query info\'s form...' . "\n";
        die(
"\n");
    }

    if(
$argc <= 1) {
       
PrintUsage('Paramètre(s) invalide(s)...');
        die(
"\n");
    }

   
$ping = new CPing();

   
$config['value'] = $argv[1];
   
$config['serveur_index'] = 0;

   
$result = $ping->WhoIs($config);
    if(
$result !== false)
        echo
$result . "\n";
    else
        echo
'Error occured while quering WhoIs server...' . "\n";

?>