http://www.hotscripts.com/PHP/Script...ers/Real-Time/
-----------------------------------------------------------------------------------
http://www.hotscripts.com/Perl/Scrip...ers/Real-Time/
Does anyone know a script that shos the users online? It can be in Perl or PHP (yes it can use mySQL)
http://www.hotscripts.com/PHP/Script...ers/Real-Time/
-----------------------------------------------------------------------------------
http://www.hotscripts.com/Perl/Scrip...ers/Real-Time/
curtosy of spoono.com
PHP Code:<?php
//fill in some basic info
$server = "localhost";
$db_user = "username";
$db_pass = "password";
$database = "users";
$timeoutseconds = 300;
//get the time
$timestamp = time();
$timeout = $timestamp-$timeoutseconds;
//connect to database
mysql_connect($server, $db_user, $db_pass);
//insert the values
$insert = mysql_db_query($database, "INSERT INTO useronline VALUES
('$timestamp','$REMOTE_ADDR','$PHP_SELF')");
if(!($insert)) {
print "Useronline Insert Failed > ";
}
//delete values when they leave
$delete = mysql_db_query($database, "DELETE FROM useronline WHERE timestamp<$timeout");
if(!($delete)) {
print "Useronline Delete Failed > ";
}
//grab the results
$result = mysql_db_query($database, "SELECT DISTINCT ip FROM useronline WHERE file='$PHP_SELF'");
if(!($result)) {
print "Useronline Select Error > ";
}
//number of rows = the number of people online
$user = mysql_num_rows($result);
//spit out the results
mysql_close();
if($user == 1) {
print("$user user online\n");
} else {
print("$user users online\n");
}
?>
Registered Linux User #258603 - http://counter.li.org/
Try using cgi-resources.com. They have bunches more scripts than hotscripts.
Its called cgi-resources. Does that mean that its ALL cgi?? Cause PHP is better (in MY opinion... dont argue with me, I dont feel like it right now...), and faster. If it has PHP scripts too, id much rather go there..
http://php.resourceindex.com/Originally posted by Lokannon
Its called cgi-resources. Does that mean that its ALL cgi?? Cause PHP is better (in MY opinion... dont argue with me, I dont feel like it right now...), and faster. If it has PHP scripts too, id much rather go there..
Bookmarks