<?php
function checkSpam($ipAddress) {
// Validate the IP address
if (!filter_var($ipAddress, FILTER_VALIDATE_IP)) {
echo "Invalid IP address format\n";
return;
}
// List of spam databases to check
$spamDatabases = array(
"b.barracudacentral.org",
"bl.spamcop.net",
"dnsbl.sorbs.net",
"zen.spamhaus.org"
);
// Check each database for the IP address
foreach ($spamDatabases as $db) {
$query = $ipAddress . "." . $db;
$result = gethostbyname($query);
// Check if the IP address is listed
if ($result == "127.0.0.2" || $result == "::1") {
echo "$ipAddress found in $db\n";
return;
} else {
echo "$ipAddress not found in $db\n";
}
}
}
// Example usage
$ipToCheck = "123.456.789.10"; // Replace this with the IP address you want to check
checkSpam($ipToCheck);
?>
ഇത് IP വിലാസ ഫോർമാറ്റിനെ സാധൂകരിക്കുന്നു, തുടർന്ന് DNSBL (DNS ബ്ലാക്ക്ലിസ്റ്റ്) ലുക്കപ്പുകൾ ഉപയോഗിച്ച് നിരവധി സ്പാം ഡാറ്റാബേസുകൾക്കെതിരെ ഇത് പരിശോധിക്കുന്നു. ഏതെങ്കിലും ഡാറ്റാബേസിൽ IP വിലാസം കണ്ടെത്തിയാൽ, അത് എവിടെയാണ് കണ്ടെത്തിയതെന്ന് സൂചിപ്പിക്കുന്ന ഒരു സന്ദേശം പ്രിൻ്റ് ചെയ്യുന്നു. അല്ലെങ്കിൽ, ഒരു പ്രത്യേക ഡാറ്റാബേസിൽ IP വിലാസം കണ്ടെത്തിയില്ലെന്ന് സൂചിപ്പിക്കുന്ന ഒരു സന്ദേശം ഇത് പ്രിൻ്റ് ചെയ്യുന്നു.
അഭിപ്രായങ്ങൾ (0)
ഇവിടെ ഇതുവരെ അഭിപ്രായങ്ങളൊന്നുമില്ല, നിങ്ങൾക്ക് ആദ്യത്തെയാളാകാം!