guest Online with details ip and browsers details
Guest Online
Collapse
X
-
Code:<?php $server = ""; $table = "visitors"; $database = ""; $username = ""; $password = ""; $connection = mysql_connect($server,$username,$password); mysql_select_db($database,$connection); $minutes = 5; $seconds = $minutes*60; $past = time()-$seconds; $now = time(); if($_SERVER["REMOTE_ADDR"]){$ip=$_SERVER["REMOTE_ADDR"];} else{$ip=$_SERVER["HTTP_X_FORWARDED_FOR"];} $brws = explode("(",$_SERVER["HTTP_USER_AGENT"]); $browser = $brws[0]; mysql_query("INSERT INTO $table SET ip='".$ip."', browser='".$browser."',date='".$now."'"); mysql_query("DELETE FROM $table WHERE date < '".$past."'"); $count = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM $table")); echo " <a href=\"online.php\">Users Online($count[0])</a> "; ?> Then make online.php file copy and paste this codes CODE <?php $server = ""; $database = ""; $username = ""; $password = ""; $connection = mysql_connect($server,$username,$password); mysql_select_db($database,$connection); $result = mysql_query("SELECT ip ,browser,date FROM visitors ORDER BY date ")or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "[b]$row[1][/b]"; $newtime =$row[2]+(6 *60 *60); echo "[b]".date("D d M y - H:i:s",$newtime)."[/b] "; echo "------------ "; } ?>
-
ip not showin lol chek it hungama-wap.net[/b]$result = mysql_query("SELECT ip ,browser,date FROM visitors ORDER BY date ")or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "$row[0]"; /* Add this line for IP */
echo "$row[1]";//browser
$newtime =$row[2]+(6 *60 *60);//for time
Comment
-
Originally posted by strikingv View PostWorking Damn Fine !!!
Comment
Comment