Server Check Part Release...

smoochy boys on tour

JackDaniels

Registered
Veteran
Jul 28, 2007
257
8
64
Aint Nothing Great or eny where near the standards and up kept of xtralist
as xtralist uses sql but ill leave that for you to figure out i aint doin all work thats
just a taste to get you going

<?php
$userip = $_SERVER['REMOTE_ADDR'];

$file_userip = fopen('(enter your folder here)/(enter ur txt file name here).txt
', 'rb');
while (!feof($file_userip)) $useripline[]=fgets($file_userip,1024);
for ($i=0; $i<(count($useripline)); $i++) {
list($userip_x) = split("\n",$useripline[$i]);
if ($userip == $userip_x) {$useripfound = 1;}
}
fclose($file_userip);

if (!($useripfound==1)) {
$file_userip2 = fopen('(enter your folder here)/(enter ur txt file name here).txt', 'ab');
$useripline = "$userip\n";
fwrite($file_userip2, $useripline, strlen($useripline));
$file_useripcount = fopen('logger/ipcount.txt', 'rb');
$useripdata = '';
while (!feof($file_useripcount)) $useripdata .= fread($file_useripcount, 4096);
fclose($file_useripcount);
list($today, $yesterday, $total, $date, $days) = split("%", $useripdata);
if ($date == date("Y m d")) $today++;
else {
$yesterday = $today;
$today = 1;
$days++;
$date = date("Y m d");
}
$total++;
$userlines = "$today%$yesterday%$total%$date%$days";

$file_usercounts2 = fopen('(enter here your folder name)/(enter here ur txt).txt', 'wb');
fwrite($file_usercounts2, $userlines, strlen($userlines));
fclose($file_usercounts2);
fclose($file_userips2);
}
?>
 

JackDaniels

Registered
Veteran
Jul 28, 2007
257
8
64
Obvs ull need to replace the $files with ur own files tht u replaced in the enter your files here bit

but u get the drift ( ps this was my starting script wen i first started php coding the status ) but now i have alot more technology in it
 

Primal

LOMCN VIP
VIP
Jun 28, 2004
1,756
102
259
Obvs ull need to replace the $files with ur own files tht u replaced in the enter your files here bit

but u get the drift ( ps this was my starting script wen i first started php coding the status ) but now i have alot more technology in it

hmmm just realised this is my script
thanks for releasing it :)

also, you'll find this isnt a server check lol, this my deal fellow is just to check how many searches have been made.....

noticing youve managed to take this, you probably have the rest of my server check etc coding, probly because i had anonymous ftp access allowed.......

this is the other half to the code (to show the output)
PHP:
<div align="center">
   <table width="204">
     <tr>
       <th colspan="2">Unique Server Searches</th>
     </tr>
     <tr>
       <td width="94"><b>Total</b></td>
       <td width="34"><?php
	  $file_searchescount = fopen('logger/searchescount.txt', 'rb');
	$searchesdata = '';
	while (!feof($file_searchescount)) $searchesdata .= fread($file_searchescount, 4096);
	fclose($file_searchescount);
	list($today, $yesterday, $total, $date, $days) = split("%", $searchesdata);
	echo $total;
?>
       </td>
     </tr>
     <tr>
       <td><b>Daily average</b></td>
       <td><?php
	echo ceil($total/$days);
?>
       </td>
     </tr>
   </table>
 </div>
 
Last edited: