PHP Classes

File: example2.php

Recommend this page to a friend!
  Classes of LlorenÁ Herrera  >  worldlocator  >  example2.php  >  Download  
File: example2.php
Role: Example script
Content type: text/plain
Description: Example 2
Class: worldlocator
Shows the location of a host in a world map.
Author: By
Last change: Some comments
Date: 14 years ago
Size: 1,526 bytes


Class file image Download
<TITLE>Testing World IP Locator: Showing a map image</TITLE>
<span style='font-size: 20px;'>Testing World IP Locator: Showing a map image</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 to download a full packet with the required images.

include "";
// Creating worldlocator object
$worldlocator = new worldlocator;
// This class could act in different ways, this example shows how to embed an <img> tag wich show a map with your location marked. See other examples.php.
    // Querying our address and controlling possible errors
if (!$worldlocator->query (""))
$worldlocator->geterror ();
// If there are no errors ...
        // embed_image puts and <img> tag in your code wich points to, this script composes and image with a map using GD, and marking your query result on the map.
        // Syntax: $worldlocatorobject->embed_image (<map name:[day|night>, <marker name:[circle|arrow]>, <CSS Style definition for the IMG tag>);
        // There are two maps and two markers bundled with this distribution, but your can easily add more, see for more info on how to do this.
echo $worldlocator->embed_image ("day", "arrow", "border-style: dashed; border-width: 1px;");