Login   Register  
PHP Classes

File: example3.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of LlorenÁ Herrera  >  worldlocator  >  example3.php  >  Download  
File: example3.php
Role: Example script
Content type: text/plain
Description: Example 3
Class: worldlocator
Shows the location of a host in a world map.
Author: By
Last change: Some comments
Date: 2002-09-04 17:10
Size: 1,506 bytes


Class file image Download
<TITLE>Testing World IP Locator: Showing a map image and info at a time</TITLE>
<span style='font-size: 20px;'>Testing World IP Locator: Showing a map image and info at a time</span><br>

// Note: If you have downloaded this files from PHPClasses, you probably haven't the required image files, and you'll get an error. Go to http://phpspain.hexoplastia.com/projects/worldlocator to download a full packet with the required images.

include "worldlocator.inc.php";
// Creating worldlocator object
$worldlocator = new worldlocator;
// This class could act in different ways, this example shows how to show some data about the location in HTML, and embed an <img> tag wich show a map with your location marked at a time. See other examples.php for simpler uses.
    // Querying our address and controlling possible errors
    // Also, you could see here that you can perform a query by hostname instead of IP.
if (!$worldlocator->query_byhostname ("www.hexoplastia.com"))
$worldlocator->geterror ();
// If there are no errors ...
echo "<b>Address queried:</b> ".$worldlocator->location["TARGET"]."<br>";
"<b>Country:</b> ".$worldlocator->location["COUNTRY"]."<br>";
"<b>Latitude / Longitude:</b>: ".$worldlocator->location["LAT"]." / ".$worldlocator->location["LONG"]."<br>";
$worldlocator->embed_image ("day""arrow""border-style: dashed; border-width: 1px;");