PDA

View Full Version : stats



madchild24
21-11-2005, 10:03 PM
can anyone tell me code for these lol i know theve been posted alot
Users Online:
Ip address:
Date:
Time:
Hosting company: like server 80 execulink
any other ones that are statistics'

Dan Williamson
21-11-2005, 10:04 PM
I think xEnigma.co.uk has a tutorial on this.

I'll probably make one, check my PHP tutorial 1 for IP adress :)

- Dan

madchild24
21-11-2005, 10:32 PM
thanx dan

Dan Williamson
21-11-2005, 10:33 PM
No problem dude, Did they have one?

- Dan

nets
21-11-2005, 10:34 PM
I can't write you a script for show users online, as it would be pretty big.
But this might work for the other stuff:


<?php
$ip = $_SERVER['REMOTE_ADDR']; //Gets IP
$date = date("d,M,y"); //Gets date
$time = date("G:i:s"); //Gets time
echo "Your IP address is $ip<br />"; //Puts the users IP on the page
echo "The date is $date<br />"; //Puts the date on the page
echo "The time is $time"; //Puts the time on the page
?>

madchild24
21-11-2005, 10:34 PM
no idea i tried to go there but cannot find server whats link to url tutorial?
nets does that print to same page?
lol nvm i got it
- Colin
lol how i get the users internet provider?

Dan Williamson
21-11-2005, 10:37 PM
Dunno,

Looks like the server is down "/

- Dan

nets
21-11-2005, 10:38 PM
What are you asking for exactly? If you put that in a document with a PHP extention (and your host supports PHP) then it will put on the page you placed it on the date, time and IP address of the user.

Dan Williamson
21-11-2005, 10:41 PM
Ok.

Create a .PHP file called onlinepeople.php

Put the following code in it.




$remote = $_SERVER["REMOTE_ADDR"];

$file = "log.txt"
;
$timeoutsecs = 30;

$timestamp = time();

$timeout = ($timestamp-$timeoutsecs);

$fp = fopen("$file", "a+");

$write = $remote."||".$timestamp."n";
fwrite($fp, $write);
fclose($fp);

$online_array = array();
$file_array = file($file);

foreach($file_array as $newdata){
list($ip, $time) = explode("||", $newdata);
if($time >= $timeout){
array_push($online_array, $ip);
}
}

$online_array = array_unique($online_array);

$online = count($online_array);
if ($online == "1") {
echo "People Online: $online";

} else {

echo "People Online: $online";
}
?>




The create a .txt file called log.txt

Put it into the same directory as your other file and CHMOD log.txt to 777 :)

Thats shows how many people online.

- Dan

madchild24
21-11-2005, 10:41 PM
lol ok thanx guy u know on sirting sites if u go on it say
Provider (example like Execulink server 6)
thanx again dan

- Colin

Dan Williamson
21-11-2005, 10:45 PM
I forgot to mention.

Add this to your iframe or whatever your using to show the stats.





<?
include ('phppage.php');
?>


Just change the info :)

- Dan

Sam
22-11-2005, 04:39 PM
Yah were havin this weird prob atm nothing seems to be working

Dan Williamson
22-11-2005, 07:05 PM
Harsh dude.

- Dan

Sam
22-11-2005, 07:15 PM
i got www.xenigma.net wrkin ;P Gerards tryin to get .co.uk wrkin ;P

Dan Williamson
22-11-2005, 07:20 PM
It will be in the parked domains bit that you get it working.

- Dan

madchild24
22-11-2005, 09:12 PM
how i make the text smaller??

Dan Williamson
22-11-2005, 10:12 PM
Use the CSS font size in the PHP include page :)

- Dan

nets
22-11-2005, 10:55 PM
To get the ISP:

<?$isp = gethostbyaddr($_SERVER['REMOTE_ADDR']);
echo "Your ISP is: $isp";
?>

Dan Williamson
22-11-2005, 10:59 PM
Lol,

Nets he's getting all the codes slowly :)

Ok if i add you in my mission?

- Dan

madchild24
22-11-2005, 11:13 PM
lol im alitle php noob but whats code to make it smaller?

nets
24-11-2005, 05:59 PM
Make what smaller? The text? You just use html.

Dan Williamson
24-11-2005, 07:10 PM
Make what smaller? The text? You just use html.

Or CSS :)

- Dan

nets
25-11-2005, 07:34 PM
Or CSS :)

- Dan
You would need HTML for the CSS, seeing as you can't just use CSS on its own.

Want to hide these adverts? Register an account for free!