Here is my code. At the bottom I make an array called $countryCount and fill it. I need that array over at text.php to figure out how to draw the image and then display it. How can I pass it over?
Thanks
Mike
<?
require_once("ip2country.php");
include ("config.php");
mysql_connect($dbhost,$dbuser,$dbpass);
@mysql_select_db($dbname) or die( "Unable to select database");
$query="SELECT * FROM WT_lastvisitors";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$countryCount = array();
for($i = 0; $i<$num; $i++)
{
$ip=mysql_result($result, $i, "ip");
echo("ip: $ip ");
$iplook = new ip2country($ip);
if($iplook->LookUp())
{
$country = $iplook->Country;
print "found a country</br>";
}
print "country: $country</br>";
if(array_key_exists($country, $countryCount))
$countryCount[$country] = $countryCount[$country] + 1;
else
$countryCount[$country] = 1;
}
print_r($countryCount);
?>
<img src="text.php/id=$imagenr">