<?
$dir4 = "report/";
$dh4 = opendir($dir4);
$giCity = geoip_open("geoip/GeoLiteCity.dat", GEOIP_STANDARD);
while (false !== ($filename4 = readdir($dh4))) {
$files4[] = $filename4;
sort($files4);
}
for ($p = 2; $p < count($files4); ++$p){
${"name" . $p} = pathinfo($files4[$p], PATHINFO_FILENAME);
${"idset" . $p} = substr("${"name" . $p}", 7, strpos("${"name" . $p} ", '-'));
${"soubor" . $p} = fopen("report/$files4[$p]", "r");
${"ipset" . $p}=fgets(${"soubor" . $p});
${"ipset2" . $p} = substr("${"ipset" . $p}", strpos("${"ipset" . $p}", ','));
${"ipset" . $p}= str_replace("${"ipset2" . $p}", "", "${"ipset" . $p}");
${"stav" . $p}=fgets(${"soubor" . $p});
${"ver" . $p}=fgets(${"soubor" . $p});
${"group" . $p}=fgets(${"soubor" . $p});
${"ipl" . $p}=fgets(${"soubor" . $p});
${"hw" . $p}=fgets(${"soubor" . $p});
${"stavh" . $p} = substr("${"stav" . $p}", 0, strpos("${"stav" . $p}", '['));
${"stav" . $p}= str_replace("${"stavh" . $p}", "", "${"stav" . $p}");
fclose(${"soubor" . $p});
//MAP loading START
${"record" . $p} = geoip_record_by_addr($giCity, ${"group" . $p});
${"lat" . $p} = ${"record" . $p}->latitude;
${"long" . $p} = ${"record" . $p}->longitude;
${"relace" . $p} = fopen("map.dat", "a");
${"text1" . $p} = '<script>';
${"text2" . $p} ='var showPosition = function (position) {';
${"text3" . $p} = 'var userLatLng = new google.maps.LatLng('."${"lat" . $p}".','."${"long" . $p}".');';
${"text4" . $p} = ' var marker = new google.maps.Marker({ position: userLatLng,title: \'BOT\',map: map });} ';
${"text5" . $p} = 'navigator.geolocation.getCurrentPosition(showPosition); </script>';
fwrite(${"relace" . $p},"
${"text1" . $p}");
fwrite(${"relace" . $p},"
${"text2" . $p}");
fwrite(${"relace" . $p},"
${"text3" . $p}");
fwrite(${"relace" . $p},"
${"text4" . $p}");
fwrite(${"relace" . $p},"
${"text5" . $p}");
fclose(${"relace" . $p});
?>
This Code works only if variable is static ${"group" . $p}->$group="xxxxxxx";
but when is reading by for it will sucessfully echo but will not work with that function ${"group" . $p}
function is acting like nothing in that variable.function dont want accept array as string and this not too group[$p] but is not empty ,i dont know why function is accepting only variables like $group = "54.112.55.111"; in array is same but its not working