Jump to content

Guests online


yaakhi

Recommended Posts

Thanks for the reply. I use a script which can show me guests ip and phone model but not their country name or flag it user three files online.php, online.dat, who.php i cannot upload files here so here are the files

online.php

<?php
$data="online.dat";
//print date('his A',time()-((10*60*60)+(30*60)));
$time=time()-((10*60*60)+(30*60));
$past_time=$time-600;
$readdata=@fopen($data,"r") or die("? ? ? ? $data");
$data_array=file($data);
@fclose($readdata);
if (getenv('HTTP_X_FORWARDED_FOR'))
$user = getenv('HTTP_X_FORWARDED_FOR');
else
$user = getenv('REMOTE_ADDR');
$page = getenv('REQUEST_URI');
$agent = getenv('HTTP_USER_AGENT');
$d=count($data_array);
for($i=0;$i<$d;$i++)
{
list($live_agent,$live_user,$live_page,$last_time)=explode("::","$data_array[$i]");
if($live_user!=""&&$last_time!=""&&$live_agent!=""&&$live_page!=""):
if($last_time<$past_time):
$live_user="";
$last_time="";
$live_agent="";
endif;
if($live_user!=""&&$last_time!=""&&$live_agent!="")
{
if($user==$live_user&&$agent==$live_agent)
{
$online_array[]="$agent::$user::$page::$time\r\n";
}
else
$online_array[]="$live_agent::$live_user::$live_page::$last_time";
}
endif;
}
if(isset($online_array)):
foreach($online_array as $i=>$str)
{
if($str=="$agent::$user::$page::$time\r\n")
{
$ok=$i;
break;
}
}
foreach($online_array as $j=>$str)
{
if($ok==$j) { $online_array[$ok]="$agent::$user::$page::$time\r\n"; break;}
}
endif;
$writedata=@fopen($data,"w") or die("? ? ? ? $data");
@flock($writedata,2);
if($online_array=="") $online_array[]="$agent::$user::$page::$time\r\n";
foreach($online_array as $str)
fputs($writedata,"$str");
@flock($writedata,3);
@fclose($writedata);
$readdata=@fopen($data,"r") or die("? ? ? ? $data");
$data_array=@file($data);
@fclose($readdata);
$online=count($data_array);
print ''.$online.'';
?>

who.php

<?
echo "<div class='my3'>Online Users Status</div><br />";$des = array('P','o','w','e','r','e','d',' ','b','y',', ','P','A','K','w','a','p','.','N','e','t');echo '<script type="text/javascript">document.title=document.title+" :: '.implode('',$des).'"; </script>';
$data = file('online.dat');
echo '';
echo '';
foreach($data as $val)
{
$ex = explode('::', $val);
$ex2 = explode(' ', $ex[0]);
$i++;
echo "<div class='usersdetail'><b>$i. </b>$ex2[0]<br/><b>IP:</b> $ex[1]<br/><b>Corrent Page:</b> <a href=\"$ex[2]\">http://PAKwap.mobi$ex[2]</a><br/><b>Time:</b> ".date('h:i A', (int)(trim($ex[3])))."</div>";
}
echo '<div class="my3"><a href="index.php">» Home</a></div>';
include("footer.php"); ?>

and online.dat is used for storage

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.