Php code on website header does work any more

To prevent unwanted visitor and spam mail i used to use ip files to block. i have been applying this code in the begin of the header file (static website) from years, is still work but while submitting on google search engine for SEO, index request is reject with soft 404 error.

Ip filter code:

$three_letter_country_code=$countries[ $two_letter_country_code][0];

function iptocountry($ip) {
    $numbers = preg_split( "/\./", $ip);
    $code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);
    foreach($ranges as $key => $value){
    if ($two_letter_country_code==""){$two_letter_country_code="unkown";}
    return $two_letter_country_code;

if ($two_letter_country_code=="PK" || $two_letter_country_code=="RU" || $two_letter_country_code=="IN")
  die("Something Went Wrong. Please Contact Your HOstinG");
  $country_codes_to_block = array('PK', 'RU', 'IN');

if i remove above code there is no error on submission on google search engine. i have face this error from few days only previous it was working fine even last week it was fine.

can anyone suggest the solutions

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.