Hi I'm using this function to check the IP and the datetime, But it dosen't stop upload, even if the time is less then 1 hour and newIP = old IP
is there is any better way to do it, if it is please let me know.
function connect_dbs($hostname, $username, $password, $dbname)
{
require ("database1.php3");
$link = mysql_pconnect("$hostname", "$username", "$password");
$Err = mysql_error();
if ($link && mysql_select_db("$dbname"))
{
$Err .= mysql_error;
return ($link);
}
else
{
echo $Err;
exit;
}
}
function check_ip($IP, $date_time)
{
require ("database_info.php3");
echo $hostname, $username, $password, $dbname;
("$hostname", "$user name", "$password");
$lasthour = time() - 3600;
$sql = "select date_time, IP from table_name where date_time > $lasthour and IP = '$REMOTE_ADDR' order by date_time desc" or die( "Query failed: error was $php_errormsg'" );
if (mysql_db_query("$dbname", $sql)== false)
{
echo "not able to get the data: ", mysql_error()."<p>";
exit;
}
return $res;
}