PHP Classes

File: ahostdisplay.php

Recommend this page to a friend!
  Classes of George Clarke   AHostLookup   ahostdisplay.php   Download  
File: ahostdisplay.php
Role: Application script
Content type: text/plain
Description: Displays blocks of IPs with count greater than 0. Used with ahostlookup.php
Class: AHostLookup
Get hostname, zip code and hit count for an IP.
Author: By
Last change: In the query statement, changed the table name from ispsc to isps.
Date: 18 years ago
Size: 1,385 bytes


Class file image Download
// This script displays the number of hits you received from each ISP.
// It reads the database used in ahostlookup class and extracts the
// information for those records with a count greater than zero. It then
// displays the information in a table.
// ****** edit next two lines to put your own username, password and database_name.

$db = mysql_connect("localhost","username","password");

<h4>A List of all table entries with a count greater than 0</h4>
<table border="5" bordercolor="000088" cellspacing="0" cellpadding="2">
  <tr bgcolor="#000088">
    <td><font color="#FFFFFF"><b>IDnum</b></font></td>
    <td><font color="#FFFFFF"><b>Host Name</b></font></td>
    <td><font color="#FFFFFF"><b>Zip Code</b></font></td>
    <td><font color="#FFFFFF"><b>Count</b></font></td>
    <td><font color="#FFFFFF"><b>Date</b></font></td>
    <td><font color="#FFFFFF"><b>Time</b></font></td>

$result = mysql_query("SELECT * FROM isps WHERE count>0 ORDER BY count");
     while (
$myrow = mysql_fetch_array($result)) {
$id = $myrow["id"];
printf("<tr bgcolor='#bbddee'><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>", $id, $myrow["host"],$myrow["zip"], $myrow["count"], $myrow["date"], $myrow["time"]);