<?
@require_once ('../lib/functions.lib.php');
db_connect();
$delete = mysql_query("TRUNCATE TABLE laendercode";);
$returned='';
$fp=@fopen($_SERVER['DOCUMENT_ROOT'].'/crons/ip-to-country.csv',"r";);
if($fp){
while($line=fgets($fp,1000)){
$line = str_replace("\"","",$line);
$werte_array=split(",",$line);
$anfuegen = mysql_query("INSERT INTO laendercode (IP_FROM, IP_TO, CC2, CC3, land) values ('$werte_array[0]','$werte_array[1]','$werte_array[2]','$werte_array[3]','$werte_array[4]')";);
//echo "$werte_array[0],$werte_array[1],$werte_array[2],$werte_array[3],$werte_array[4] <br>";
}
fclose($fp);
}
// Zeit setzen
db_query ("UPDATE ".$db_prefix."_crons SET laufzeit = '".time()."' WHERE bezeichnung = 'Laendercode-DateiUpdate'";);
db_close();
?>