Forum Moderators: phranque
I'm getting an "Internal Server Error" when I call up the site now.
This was designed to block out a specific country.
Can someone tell me where I'm going wrong or point me in the right direction?
I put this in my .htaccess file.
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
#
And I did that to handle this PHP script I put at the top of my .html pages.
<?php
function iptonumber($ip){
$ip=explode('.', $ip);
return $ip[0]*pow(256, 3)+$ip[1]*pow(256, 2)+$ip[2]*256+$ip[3];
}
$ips=unserialize('a:8366:{i:0;a:2:{s:5:"minip";s:8:"33996344";s:5:"maxip";s:8:"33996351";}i:1;a:2:*******and the rest of the entire range of IPs*****"minip";s:10:"3577603040";s:5:"maxip";s:10:"3577603055";}}');
foreach($ips as $ip){
if($number<=$ip['maxip'] and $number>=$ip['minip']){
echo "SERVER ERROR\n";
exit;
}
}
?>
[edited by: Michel_Samuel at 1:07 pm (utc) on Jan. 17, 2007]