<?php
include_once("config.php");
include_once("iptools.php");
//Needed
$msg = "";
if(isset($_POST['update']) && basename($_FILES['gzFile']['name']) != ""){
//$file = basename($_FILES['gzFile']['name']);
$uploaddir = dirname((__FILE__))."/uploads/";
$uploadfile = $uploaddir.basename($_FILES['gzFile']['name']);
$new_File_Name = $uploaddir."IpToCountry.csv";
if(file_exists($uploadfile)){
unlink($uploadfile);
}
if (move_uploaded_file($_FILES['gzFile']['tmp_name'], $uploadfile)) {
//echo "File is valid, and was successfully uploaded.\n";
chmod($uploadfile, 0777);
} else {
$msg = "Possible file upload attack!\n";
}
$new_File = create_File($uploadfile, $new_File_Name);
if($new_File == 0){
$msg = "New file successfully created <br>";
$load_File = load_Into_DB($db_Specs, $new_File_Name);
if($load_File != -1){
$msg .= sprintf("The databale has been successfully updated, %s rows where created.", $load_File);
}
else{
$msg .= "The database could not be updated!!";
}
}
else{
$msg = "The new file could not be created";
}
}
$ip = (isset($_GET['ip']) ? $_GET['ip'] : $_SERVER['REMOTE_ADDR']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>esTigi IpTools for WebNet777</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>
<a href="..">
<h1><< Back to Ads Server</h1>
</a>
<a href="index.php">
<h1>esTigi IpTools for Webnet 777</h1>
</a>
<h2><?php echo $msg; ?></h2>
<form enctype="multipart/form-data" action="index.php" method="post">
<table class="uno">
<tr>
<td colspan="2" class="menuTitle" align="center">
Only 2 easy steps
</td>
</tr>
<tr>
<td>
<span class="step">Step 1: Download Current Database</span>
</td>
<td>
<a href="http://software77.net/cgi-bin/ip-country/geo-ip.pl?action=download">Here!</a>
</td>
</tr>
<tr>
<td>
<span class="step">Step 2: Update database with the new file: </span>
</td>
<td>
<input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
<input type="file" name="gzFile" class="texto">
<input type="submit" name="update" value="Update" class="texto">
</td>
</tr>
</table>
</form>
<br />
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top">
<table class="uno">
<tr>
<td colspan="2" class="menuTitle">
Your current configuration is:
</td>
</tr>
<tr>
<td>
Host:
</td>
<td>
<span class="config">
<?php echo $db_Specs['host']; ?>
</span>
</td>
</tr>
<tr>
<td>
User:
</td>
<td>
<span class="config">
<?php echo $db_Specs['user']; ?>
</span>
</td>
</tr>
<tr>
<td>
Password:
</td>
<td>
<span class="config">
Sure!!!
</span>
</td>
</tr>
<tr>
<td>
Database Name:
</td>
<td>
<span class="config">
<?php echo $db_Specs['db_Name']; ?>
</span>
</td>
</tr>
<tr>
<td>
Ips Table Name:
</td>
<td>
<span class="config">
<?php echo $db_Specs['ips_Name']; ?>
</span>
</td>
</tr>
<tr>
<td>
Countries Table Name:
</td>
<td>
<span class="config">
<?php echo $db_Specs['countries_Name']; ?>
</span>
</td>
</tr>
</table>
</td>
<td valign="top">
<iframe align="top" width="220" height="300" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0"
scrolling="no" src='iplookup.php'>
</iframe>
</td>
</tr>
</table>
<br />
<br />
<div class="footer">
Powered with <a href="http://estigi.org">esTigi Ips v 0.1</a>, this is Open Source software to work with the <a href="http://software77.net/cgi-bin/ip-country/geo-ip.pl">WebNet777</a> FREE Updated IP to Country Database.
</div>
</body>
</html>