Domanda

Can anyone help me with this error? When running the site on my host i get no errors but when i run it with xampp on my pc i get this

Notice: Undefined offset: 1 in C:\xampp1\htdocs\ctcoun1kk\countrycheck.php on line 273

Notice: Undefined offset: 2 in C:\xampp1\htdocs\ctcoun1kk\countrycheck.php on line 273

Notice: Undefined offset: 3 in C:\xampp1\htdocs\ctcoun1kk\countrycheck.php on line 273

Line 273 is this one->

$decip = ($numbers[0]*16777216)+($numbers[1]*65536)+($numbers[2]*256)+($numbers[3]);

function x_dot2dec($dotip) { 
    $numbers = preg_split( "/./", $dotip); 
    $decip = ($numbers[0]*16777216)+($numbers[1]*65536)+($numbers[2]*256)+($numbers[3]); 
    return array ($decip, $numbers[0]); 
}

Thank you for any help :)

È stato utile?

Soluzione 2

Those are just notices. The script should work fine if you ignore thos. Set error reporting level using error_reporting (http://www.php.net/manual/en/function.error-reporting.php) and those will go away. This is set on your other server- that's why you don't see these "errors".

error_reporting(0); //disable all errors and notices

Altri suggerimenti

It means that $numbers variable is not set properly. Before 273 line put:

var_dump($numbers);

and check if indexes 0,1,2 and 3 are set

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top