Jump to content
php.lv forumi

freehostu apiešana


MārisL

Recommended Posts

Izmantoju xlphp.net.

Lieta tāda, ka viņš neatļauj izmantot statistikas, online skriptu. Itkā failā viņš ir ielikts, bet ieejot lapā viss, kas atradās zem koda pazūd.

Esmu statistiku mēģinājis uz sava PC, viss iet!

 

nav iespējams kaut kā apiet viņus?

Link to comment
Share on other sites

<?

$ip = $REMOTE_ADDR;

$time = time();

$minutes = 15;

$found = 0;

$users = 0;

$user = "";

 

$tmpdata = $DOCUMENT_ROOT."/statistika/data";

 

if (!is_file("$tmpdata/online.txt"))

{

$s = fopen("$tmpdata/online.txt","w");

fclose($s);

chmod("$tmpdata/online.txt",0666);

}

 

$f = fopen("$tmpdata/online.txt","r+");

flock($f,2);

 

while (!feof($f))

{

$user[] = chop(fgets($f,65536));

}

 

fseek($f,0,SEEK_SET);

ftruncate($f,0);

 

foreach ($user as $line)

{

list($savedip,$savedtime) = split("\|",$line);

if ($savedip == $ip) {$savedtime = $time;$found = 1;}

if ($time < $savedtime + ($minutes * 60))

{

fputs($f,"$savedip|$savedtime\n");

$users = $users + 1;

}

}

 

if ($found == 0)

{

fputs($f,"$ip|$time\n");

$users = $users + 1;

}

 

fclose ($f);

print "Apmeklētāji pašlaik skatās lapu: <strong>$users</strong>";

 

?>

Link to comment
Share on other sites

vel varu piebilst ka online tabulu ir sapratigi turet atminjaa --> tabulu kaa Memory ... tik jauzliek maksimalais atljauto Rowu skaits (ja to neizdaris apeediis visu peiejamo Ramu....)

tas atrdarbibu palielinaas vismaz 10X reizes....

Statistiku (kas bijis ko redzejis, gan taa nevajag taisiit)

---

MEMOry tipa tabulas dati pazudiis pie servera restarta, bet njemot veraa ka tas ir ONLINE dati tad --> vairs nav noziimes...

Pameklejies seit pat forumaa ---> Savaaksi krietnu kaudzi vertigas Infas...

Link to comment
Share on other sites

×
×
  • Create New...