Скрипт такой:
CODE:
<?php
include("geoipcity.inc");
echo
"<center><form name=form method=post action=regi-test.php>
<input type=submit value=send>";
$include = "file.txt";
$filename = "file6.txt";
$fp = fopen( $filename, "r+" ) or die ("no file opening is occuring"); //$fp is short for file pointer
flock($fp,1); //allows file reading but prevents writing
$counter = fgets( $fp, 6 ); //sets variable counter to where filepointer is
$counter++; // increments counter by 1
rewind($fp); // re-sets file pointer to start of file.
fputs( $fp, $counter); //writes the value of the counter to where filepointer is.
flock($fp,3); //releases file
global $file6, $include;
$include = "file6.txt";
echo
"<center><form name=form1 method=post action=regi-test.php>
<select name=qwe1 size=1>
<option value=$counter>Счётчик</option>
<option value=224>224</option>
<option value=121>121</option>
<option value=80>80</option>
<option value=212>212</option>
</select>
<form name=form2 method=post action=regi-test.php>
<select name=qwe2 size=1>
<option value=$counter>Счётчик</option>
<option value=224>224</option>
<option value=121>121</option>
<option selected value=80>80</option>
<option value=212>212</option>
</select>
<form name=form3 method=post action=regi-test.php>
<select name=qwe3 size=1>
<option value=$counter>Счётчик</option>
<option value=224>224</option>
<option value=121>121</option>
<option selected value=80>80</option>
<option value=212>212</option>
</select>
<form name=form4 method=post action=regi-test.php>
<select name=qwe4 size=1>
<option value=$counter>Счётчик</option>
<option value=224>224</option>
<option value=121>121</option>
<option selected value=80>80</option>
<option value=212>212</option>
</select></form>";
$ny1=$_POST['qwe1'];
$ny2=$_POST['qwe2'];
$ny3=$_POST['qwe3'];
$ny4=$_POST['qwe4'];
$gi = geoip_open("GeoIPCit.dat",GEOIP_STANDARD);
$record = geoip_record_by_addr($gi, "$ny1.$ny2.$ny3.$ny4");
$giorg = geoip_open("GeoIPOrg.dat",GEOIP_STANDARD);
$org = geoip_org_by_addr($giorg, "$ny1.$ny2.$ny3.$ny4");
$new_arr = $ny1."|".$ny2."|".$ny3."|".$ny4."|".$record->country_name."|".$record->city."|".$record->country_code . "|" . $record->country_code3 . "|" .$record->latitude . "|". $org . "|" . $record->region. "\n";
$ufile = "users2.log";
if (!file_exists ($ufile))
{
$fp = fopen($ufile, 'w');
}
else
{
$fp = fopen ($ufile, 'a');
}
fputs ($fp, $new_arr);
geoip_close($gi);
geoip_close($giorg);
fclose ($fp);
?>
Вместо кнопки вверху скрипта,а именно
CODE:echo
"<center><form name=form method=post action=regi-test.php>
<input type=submit value=send>";
Должно быть автоматическое повторение этой функции 50 раз.Весь скрипт зацикливать нельзя так как и формы на странице рисуются 50 раз.Нажимать кнопкой 50 раз тоже не дело.Короче кнопка должна нажиматься 50 раз автоматом. |