Register for your free account! | Forgot your password?

You last visited: Today at 16:00

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Server status HELP!!

Discussion on Server status HELP!! within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #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$errstr1);
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
neverhere is offline  
Old 04/10/2011, 19:18   #2
 
synergie's Avatar
 
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
synergie is offline  
Old 04/10/2011, 19:29   #3
 
.Kinshi's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
Yes lets use IFrames because this is the 90s!
.Kinshi is offline  
Old 04/10/2011, 20:47   #4
 
synergie's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 18
Received Thanks: 5
Quote:
Originally Posted by .Kinshi View Post
Yes lets use IFrames because this is the 90s!
Lol, why not its easy and works ^^
synergie is offline  
Old 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.
pro4never is offline  
Old 04/10/2011, 23:36   #6
 
.Kinshi's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
Quote:
Originally Posted by synergie View Post
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.
.Kinshi is offline  
Old 04/11/2011, 14:19   #7
 
synergie's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 18
Received Thanks: 5
Quote:
Originally Posted by .Kinshi View Post
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
synergie is offline  
Old 04/12/2011, 03:41   #8
 
.Kinshi's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
Quote:
Originally Posted by synergie View Post
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>
.Kinshi is offline  
Old 04/13/2011, 12:21   #9
 
elite*gold: 0
Join Date: Apr 2011
Posts: 73
Received Thanks: 12
Quote:
Originally Posted by .Kinshi View Post
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.
Secured is offline  
Old 04/13/2011, 12:36   #10


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Quote:
Originally Posted by Secured View Post
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.
Korvacs is offline  
Old 04/13/2011, 13:38   #11
 
elite*gold: 0
Join Date: Apr 2011
Posts: 73
Received Thanks: 12
Quote:
Originally Posted by Korvacs View Post
Actually by modifying .htaccess you can have html parsed for php.
And you assume OP knows how to do that?
Secured is offline  
Old 04/13/2011, 13:49   #12


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Quote:
Originally Posted by Secured View Post
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.
Korvacs is offline  
Old 04/14/2011, 21:32   #13
 
.Kinshi's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
Quote:
Originally Posted by Secured View Post
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 View Post
Actually by modifying .htaccess you can have html parsed for php.
Exactly.
.Kinshi is offline  
Reply


Similar Threads 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.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.