My (shared) host provider has upgraded to php5 from php4 and now I am getting errors in the php code. They will not provide help or further info about .ini file.
Can someone guide me as to what's wrong:
Error 1:
<?php if ($submit && !$errors) {
gives error msg:
Notice: Undefined variable: submit in line 196.
Error 2:
<?php
if ($_SERVER['HTTP_X_FORWARDED_FOR'])
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
else
$ip = $_SERVER['REMOTE_ADDR'];
$two_letter_country_code=iptocountry($ip);
function iptocountry($ip)
{
$numbers = preg_split( "/./", $ip);
include("ip_database.php");
$code=($numbers[0] * 16777216)
+ ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);
foreach($ranges as $key=>$value)
{
if($key<=$code)
{
if($ranges[$key][0]>=$code)
{
$country=$ranges[$key][1];break;}
}
}
if ($country=="")
{
$country="unknown";
}
return $country;
}
if ($two_letter_country_code =="ZA") {
echo "ERROR 404 : PAGE NOT AVAILABLE";
die();
}
?>
Gives error messages:
Notice: Undefined index: HTTP_X_FORWARDED_FOR ....on line 2
-and-
Notice: Undefined variable: country in .... on line 20