function logAccess()
{
define('_VALID_CODE', true);
include_once 'database.php';
$dbh = new Database();
$dbh->init();
$ipaddr_base = $_SERVER['REMOTE_ADDR'];
if (is_array($ipaddr_base)) {
$ipaddr = $ipaddr_base[0];
} else {
$ipaddr = $ipaddr_base;
}
//echo("--> " . $ipaddr);
$query = "SELECT * FROM downloads26 WHERE ipaddr = '{$ipaddr}';";
$result = $dbh->doQuery($query);
if (mysql_num_rows(&$result) > 0) {
/*$row = mysql_fetch_array(&$result);
if (intval( $row['attempts'] ) > 50)
{
die("Sorry, you've attempted to download StealthBot too many times. Please contact Stealth by <a href='mailto:[email protected]'>email</a> if you need another copy, or if you received this message in error.");
} */
$query = "UPDATE downloads26 SET attempts=attempts+1 WHERE ipaddr='{$ipaddr}';";
} else {
$query = "INSERT INTO downloads26(ipaddr, attempts) VALUES('{$ipaddr}', 1);";
}
mysql_free_result($result);
$result = $dbh->doQuery($query);
}