I changed it to use one..now code is as follows
PHP Code:
// Query for getting visitor countrycode
if (isset($_POST[submit]))
{
$cc = $_POST['country'];
$query = $DB_site->query("SELECT * FROM ip_to_country WHERE COUNTRY_CODE2='$cc'");
while ($results = $DB_site->fetch_array($query))
{
$ip_from = long2ip($results[IP_FROM]);
$ip_to = long2ip($results[IP_TO]);
$country = $results[COUNTRY_NAME];
echo "$ip_from - $ip_to ";
eval('$range_results = "' . fetch_template('range_results') . '";');
}
eval('print_output("' . fetch_template('country_results') . '");');
}
Range_Results Template:
Code:
<td class="alt1" width="50%"]>$ip_from</td>
<td class="alt2" width="50%">$ip_to</td>
Country_Results template
Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<!-- end no cache headers -->
<title>Country Results Page</title>
$headinclude
</head>
<body>
$header
$navbar
<!-- main --><table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td align="center" class="tcat">
IP Ranges For <i><u>$country</i></u></td>
</tr>
</table>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr align="center">
<td class="thead" width="50%" align="center">Range Start
</td>
<td class="thead" width="50%">Range End
</td>
</tr>
</thead>
<tr align="center">
$range_results
</tr>
</table>
<!-- /main -->
$footer
</body>
</html>