PHP Classes

File: examples.php

Recommend this page to a friend!
  Classes of Thomas Trautner   Network Tools   examples.php   Download  
File: examples.php
Role: Example script
Content type: text/plain
Description: Function examples
Class: Network Tools
Perform diagnostics of access to Internet services
Author: By
Last change: number of pings
Date: 3 months ago
Size: 1,494 bytes
 

Contents

Class file image Download
<?php
include "network_tools.php";
$tools = new NetworkTools();
$domain = "google.com";
$tcpResult = $tools->tcp($domain, 80, 10);
$tools->display($tcpResult,"TCP - ".$domain." Port 80");
echo
"<hr>";
$smtpResult = $tools->smtp('smtp.'.$domain, 25, 10);
$tools->display($smtpResult,"SMTP - ".$domain." Port 25");
echo
"<hr>";
$httpResult = $tools->http('http://'.$domain);
$tools->display($httpResult,"HTTP - ".$domain);
echo
"<hr>";
$httpsResult = $tools->https($domain);
$tools->display($httpsResult,"HTTPS - ".$domain);
echo
"<hr>";
$ptrResult = $tools->ptr("8.8.8.8");
$tools->display($ptrResult,"PTR - 8.8.8.8");
echo
"<hr>";
$pingResult = $tools->ping($domain, 4); // ---- NEEDS SOME TIME
$tools->display($pingResult,"PING (4x) - ".$domain);
echo
"<hr>";
$traceResult = $tools->trace($domain, 20); // ---- NEEDS SOME TIME
$tools->display($traceResult,"Traceroute - ".$domain);
echo
"<hr>";
$mxResult = $tools->mx($domain);
$tools->display($mxResult,"MX - ".$domain);
echo
"<hr>";
$aResult = $tools->a($domain);
$tools->display($aResult,"A - ".$domain);
echo
"<hr>";
$txtResult = $tools->txt($domain);
$tools->display($txtResult,"TXT - ".$domain);
echo
"<hr>";
$cnameResult = $tools->cname($domain);
$tools->display($cnameResult,"CNAME - ".$domain);
echo
"<hr>";
$soaResult = $tools->soa($domain);
$tools->display($soaResult,"SOA - ".$domain);
echo
"<hr>";
$spfResult = $tools->spf($domain);
$tools->display($spfResult,"SPF - ".$domain);