Thread: PHP Help
-
April 4th, 2012, 04:47 AM #1Member
- Join Date
- Apr 2008
- Posts
- 45
PHP Help
I didn't write this code but I was curious if I could make it display Ping and the number of Players connected as well as the Online/Offline status it already displays.
If you look here, you'll notice third party websites are able to do it so I'm curious if you could do something similar like a Ping/Active Connection check.Code:<?php // Language constants. Translate into your native language if needed. $language = array( 'server_online' => 'Age of War is <font color="#04B404">Online</font>.', 'server_offline' => 'Age of War is <font color="#FF0000">Offline</font>.', ); // Connection timeout in seconds. If the script cannot connect to a server before this timeout, // then that server is considered to be offline. Don't make this too big or your website could // take a long time to load. $timeout = 1; $RunUo = array( 'check' => true, // Should we check the status of the RunUo server? (true or false) 'ip' => 'play.uoageofwar.com', // IP of the RunUo server 'port' => 2593, // Port of the RunUo server ); $output = ""; if ($RunUo['check']) { if ($fp = @fsockopen($RunUo['ip'], $RunUo['port'], $errno, $errstr, $timeout)) { fclose($fp); $RunUo_online = true; $output .= "<p>\n"; $output .= " ".$language['server_online']."\n"; $output .= "</p>\n"; } else { $RunUo_online = false; $output .= "<p>\n"; $output .= " ".$language['server_offline']."\n"; $output .= "</p>\n"; } } echo $output; ?>
UOGateway - Age of War
Here is my website if you want to get an idea of how the status looks on the left
Age Of War | Ultima Online PvP the way it should be.
I would like for it to look like.
Age of War is Online
Players: X
Ping: X
In advanced, thanks.Last edited by Evanonian; April 4th, 2012 at 04:51 AM.
"The ultimate measure of a man is not where he stands in moments of comfort, but where he stands at times of challenge and controversy."
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
php help
By sr71000 in forum Webmastering and ProgrammingReplies: 2Last Post: February 26th, 2007, 02:03 PM -
php coding assistance with templete.php
By herbal_lavender in forum Webmastering and ProgrammingReplies: 2Last Post: December 29th, 2005, 09:35 AM -
index.php?mode=something.php
By RyanD in forum Webmastering and ProgrammingReplies: 16Last Post: October 20th, 2004, 10:20 PM -
PHP - Help?
By Blazer06 in forum Webmastering and ProgrammingReplies: 8Last Post: September 5th, 2003, 12:29 AM -
Need php help
By iNeb in forum Webmastering and ProgrammingReplies: 9Last Post: April 10th, 2003, 11:38 PM



LinkBack URL
About LinkBacks



Reply With Quote

here you can see a comparison of the 7850 vs GTX 570 (GTX 560 Ti 448 is reduced spec 570, so the 448 Core would be close to the 7850 in performance, if not just behind it a hair): AnandTech |...
Suggested upgrades for a Gaming...