|
You last visited: Today at 16:00
Advertisement
Server status HELP!!
Discussion on Server status HELP!! within the CO2 Private Server forum part of the Conquer Online 2 category.
04/10/2011, 02:30
|
#1
|
elite*gold: 0
Join Date: Feb 2011
Posts: 25
Received Thanks: 3
|
Server status HELP!!
how i put this :
PHP Code:
<?php require_once ('config.php');
mysql_select_db($accdb); $res = mysql_query('SELECT count(id) FROM account;'); $val = mysql_fetch_array($res); echo '<font color="#45BEFF", size="2px"> <b>Total Accounts:</b> '.$val[0].'<br />';
mysql_select_db($gamedb); $res = mysql_query('SELECT count(id) FROM cq_user;'); $val = mysql_fetch_array($res); echo '<b>Total Characters:</b> '.$val[0].'<br />';
echo '<b>Server Status:</b> '; $fp = @fsockopen($serveraddress, $serverport, $errno, $errstr, 1); if (!$fp) { echo '<font style="color: #FF3300"><b>Offline</b></font><br />'; } else { echo '<font style="color: #FFFFFF"><b>Online</b></font><br />'; fclose($fp); }
?> <b>Total Players Online:</b> <b><?php echo (exec('netstat -a -n |find "5816" |find "ESTABLISHED" /c')-3); ?></b><br />
in my website(html), like all the server did.
like this one
|
|
|
04/10/2011, 19:18
|
#2
|
elite*gold: 0
Join Date: May 2008
Posts: 18
Received Thanks: 5
|
Hi,
Well put you php script into a random php file
Example: Status.php with your codes in it
Code:
<?php
require_once ('config.php');
mysql_select_db($accdb);
$res = mysql_query('SELECT count(id) FROM account;');
$val = mysql_fetch_array($res);
echo '<font color="#45BEFF", size="2px"> <b>Total Accounts:</b> '.$val[0].'<br />';
mysql_select_db($gamedb);
$res = mysql_query('SELECT count(id) FROM cq_user;');
$val = mysql_fetch_array($res);
echo '<b>Total Characters:</b> '.$val[0].'<br />';
echo '<b>Server Status:</b> ';
$fp = @fsockopen($serveraddress, $serverport, $errno, $errstr, 1);
if (!$fp) {
echo '<font style="color: #FF3300"><b>Offline</b></font><br />';
}
else
{
echo '<font style="color: #FFFFFF"><b>Online</b></font><br />';
fclose($fp);
}
?>
<b>Total Players Online:</b> <b><?php echo (exec('netstat -a -n |find "5816" |find "ES
save it and place it with your source (into the website folder of your server , normally C:/AppsServer/www)
Then put this into your HTML source codes at the place you want
Code:
<IFRAME style=" border="0" name="I1" src="http://[COLOR="Red"][SERVERIP][/COLOR]/Status.php" frameborder="0" width="626" height="801" resizing="no">
you can cange the height and width to your own preferences. so the box with all info i fully shown
This is the basic and most used way to put in your script in HTML. I hope it helps you
Greets
Synergie
|
|
|
04/10/2011, 19:29
|
#3
|
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
|
Yes lets use IFrames because this is the 90s!
|
|
|
04/10/2011, 20:47
|
#4
|
elite*gold: 0
Join Date: May 2008
Posts: 18
Received Thanks: 5
|
Quote:
Originally Posted by .Kinshi
Yes lets use IFrames because this is the 90s!
|
Lol, why not its easy and works ^^
|
|
|
04/10/2011, 21:00
|
#5
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
|
It's bad practice... just place the php code within your existing template.
|
|
|
04/10/2011, 23:36
|
#6
|
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
|
Quote:
Originally Posted by synergie
Lol, why not its easy and works ^^
|
It's old and outdated, plus it looks bad and doesn't play well with a lot of things.
Use a php include() instead.
|
|
|
04/11/2011, 14:19
|
#7
|
elite*gold: 0
Join Date: May 2008
Posts: 18
Received Thanks: 5
|
Quote:
Originally Posted by .Kinshi
It's old and outdated, plus it looks bad and doesn't play well with a lot of things.
Use a php include() instead.
|
include only works when your site is also build in PHP. won't work for html
|
|
|
04/12/2011, 03:41
|
#8
|
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
|
Quote:
Originally Posted by synergie
include only works when your site is also build in PHP. won't work for html
|
As long as your web server supports PHP, you can put it anywhere.
Code:
<html>
<body>
<h1>My awesome server</h2>
<p><?php include('serverstatus.php'); ?></p>
</body>
</html>
|
|
|
04/13/2011, 12:21
|
#9
|
elite*gold: 0
Join Date: Apr 2011
Posts: 73
Received Thanks: 12
|
Quote:
Originally Posted by .Kinshi
As long as your web server supports PHP, you can put it anywhere.
Code:
<html>
<body>
<h1>My awesome server</h2>
<p><?php include('serverstatus.php'); ?></p>
</body>
</html>
|
Only if the extenstion is .php.
It won't work for htm, html, xml etc.
The point is OP is using html for his site and it won't work if he ain't switching his file extenstion to .php.
|
|
|
04/13/2011, 12:36
|
#10
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Quote:
Originally Posted by Secured
Only if the extenstion is .php.
It won't work for htm, html, xml etc.
The point is OP is using html for his site and it won't work if he ain't switching his file extenstion to .php.
|
Actually by modifying .htaccess you can have html parsed for php.
|
|
|
04/13/2011, 13:38
|
#11
|
elite*gold: 0
Join Date: Apr 2011
Posts: 73
Received Thanks: 12
|
Quote:
Originally Posted by Korvacs
Actually by modifying .htaccess you can have html parsed for php.
|
And you assume OP knows how to do that?
|
|
|
04/13/2011, 13:49
|
#12
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Quote:
Originally Posted by Secured
And you assume OP knows how to do that?
|
No, but you stated explicitly that it couldnt be done, assuming that the OP doesnt know how to do it, so i thought i would mention that it is actually possible.
|
|
|
04/14/2011, 21:32
|
#13
|
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
|
Quote:
Originally Posted by Secured
Only if the extenstion is .php.
It won't work for htm, html, xml etc.
The point is OP is using html for his site and it won't work if he ain't switching his file extenstion to .php.
|
Quote:
Originally Posted by Korvacs
Actually by modifying .htaccess you can have html parsed for php.
|
Exactly.
|
|
|
 |
Similar Threads
|
[Bots/Tools/Cheats/Hacks] mit Status / with Status [Up2Date]
10/10/2013 - Browsergames - 207 Replies
Hallo liebe Browsergame-Section,
Ich habe Shadow992 gefragt ob ich einen Thread mit allen funktionierenden Bots/Tools/Cheats/Hacks machen darf, und er hat eingewilligt.
Seafight:
Bot/Tool/Cheat/Hack | Status | Bewertung | Thread
Seafight Bonus Map Bot | Funktioniert | 90% | Klick
Facebook:
|
Reg Page Edited Server Status + Extra Status
08/26/2012 - SRO Coding Corner - 22 Replies
This is a new realease of the reg page created by Xsense
Download XAMP apache friends - xampp for windows
Reg Page Files (By Tazdingo And Xsense) : Multiupload.com - upload your files to multiple file hosting sites!
1. Install XAMP
2. Go to the PHP folder of the xampplite (C:\xampplite\php) and search PHP.ini
3. In the PHP.ini search ;extension=php_mssql.dl and delete ";"
|
[Server Status] Server Status Programs From A Couple Servers.
11/05/2008 - Conquer Online 2 - 9 Replies
Hey i dont know in what section to post it so i hope that the mods will move it to the good section but i made this server status program i will make later more server status programs for other servers.
PhoenixCo:
Server Checker
Qonquer
Qonquer Server Checker
Screenshot:
http://i286.photobucket.com/albums/ll115/aschwinh /sdfsdfsdf.jpg
|
All times are GMT +1. The time now is 16:00.
|
|