View Single Post
  #2  
Old 05-27-2007, 07:41 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by Tigairius View Post
I am trying to do a "Live Stats" section on Ol' Wests new site.
under actionPlayeronline on the Control-NPC I wrote:
requesthttp("olwest.awardspace.com", 80, "index.php?do=stats&pcount=" @ allplayerscount);

and on the stats page I wrote:

<?PHP
if($_GET['pcount'] > 0){
$content = $_GET['pcount'];
$fp = fopen("./stats.txt","wb");
fwrite($fp,$content);
fclose($fp);
}
$display = fopen("./stats.txt","r");
$line = fgets($display);
echo"There are currently ". $line ." people online.";
?>

For some reason the request HTTP isn't working on my server, is it disabled? I spoke with Björn about how he did it on his Graal Kingdoms Lib site, and he said it doesn't work anymore but he's not sure why. Any input on this?
Try using requesturl:

PHP Code:
temp.link "http://www.server.com/path/to/script.php?whatever=foo";
requesturl(temp.link); 
Thats how I get live stats on my webserver.


Also, For the PHP file, Try this:

PHP Code:
<?php
if (isset($_GET['playersonline']))
{
    
$data fopen("serverdata.txt""w+") or die("");
    
    
fputs($data$_GET['playersonline']);
}
?>
__________________
What signature? I see no signature?
Reply With Quote