Jump to content

Recommended Posts

  • 3 weeks later...
  • 6 months later...
Posted

This is a php script. Make a new file *.php, upload it on your FTP, open some internet browser, enter your website address with the *.php file call, and look.

 

This is a tool for server webmaster who need to display the online player of a server. This is not a cheat, this is not a crap, this is just a php script.

 

More, I think the code is really simple and understable with all the comments, just need to read and not flood asking noob questions about that. If you don't know what this code is talking about, if you don't know what php is done to do, just look and close your flooding spamming fingers.

dude it didn't work if i put the php file with the code inside the website show a white page with this :

'; //prints out the $x number of players online ?>

 

any solution ?

  • 3 weeks later...
  • 1 month later...
Posted

Parse error: syntax error, unexpected T_STRING in C:\Program Files\VertrigoServ\www\status\Map\map.php on line 27

what's wrong???

 

i use this code

 

 

<?php

//first you need to define db info

  define('mySQL_hostname', '127.0.0.1');  //database IP

  define('mySQL_database', 'Database');  //database name

  define('mySQL_username', 'User');  //database user

  define('mySQL_password', 'Pass');  //database password

 

//connects to mysql

  $db_link = mysql_pconnect( mySQL_hostname, mySQL_username, mySQL_password )

    or die( 'Error connecting to mysql<br><br>'.mysql_error() );

 

//connects to Database

  $db_select = mysql_select_db( mySQL_database, $db_link )

    or die( 'Error connecting to Database<br><br>'.mysql_error() );

 

//selects desired table

  $chars=mysql_query("SELECT * FROM `characters` WHERE `accesslevel`=0);

 

//tells how much rows are there (will come helpfull with while loops)

  $rows =mysql_numrows($characters);

 

  $i=0;

  $x=0;

 

//while $i is smaller than number of rows repeat the code

  while ($i < $rows) {

    $online=mysql_result($chars,$i,"online"); //looks into characters table, under column online(if player is online its "1" else "0"), at row $i

    if ($online == 1) { $x++; } // if column online at row $i is "1", increase $x

    $i++; //increase $i

    }

  print 'Online players:<em>'.$x.'<em>'; //prints out the $x number of players online

?>

  • 3 weeks later...
Posted

My Server Status Script:

 

<?php

////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////// Created By Mentor www.teamsrv.net ////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////


$login_ip = "127.0.0.1";
$login_port = "2106";
$game_ip = "127.0.0.1";
$game_port = "7777";
$ventrilo_ip = "127.0.0.1";
$ventrilo_port = "3784";

$mysql_host = "127.0.0.1";
$mysql_user = "root";
$mysql_passwd = "root";
$mysql_db = "l2jdb";

///////////////////////////
////////Login Server///////
///////////////////////////
$ls = @fsockopen ($login_ip, $login_port, $errno, $errstr, 1);
if ( $ls ) 
    $ls = "<font color=green>Online</font>"; 
else 
    $ls = "<font color=red>Offline</font>"; 

///////////////////////////
////////Game Server ///////
///////////////////////////
$gs = @fsockopen ($game_ip, $game_port, $errno, $errstr, 1);
if ( $gs ) 
    $gs = "<font color=green>Online</font>"; 
else 
    $gs = "<font color=red>Offline</font>"; 

///////////////////////////
////////Vent Server ///////
///////////////////////////
$ve = @fsockopen ($ventrilo_ip, $ventrilo_port, $errno, $errstr, 1);
if ( $ve ) 
    $ve = "<font color=green>Online</font>"; 
else 
    $ve = "<font color=red>Offline</font>"; 


/////////////////////////////
////MySQL Login Server///////
/////////////////////////////

mysql_connect($mysql_host, $mysql_user, $mysql_passwd) or die ("Nem sikerült csatlakozni a MySQL szerverhez!");
mysql_select_db($mysql_db) or die("Nincs ilyen adatbázis: ".$mysql_db); 

// All Accounts
$accounts=mysql_numrows(mysql_query("SELECT * FROM accounts"));

// Online Players Num
$num=mysql_numrows(mysql_query("SELECT * FROM characters WHERE online=1 and accesslevel=0"));

// Online GMs Num
$gmnum=mysql_numrows(mysql_query("SELECT * FROM characters WHERE online=1 and accesslevel>0"));

// All Alliance Num
$alliance=mysql_numrows(mysql_query("SELECT * FROM clan_data WHERE ally_name!=\'\'"));

// All Characters
$char=mysql_numrows(mysql_query("SELECT * FROM characters WHERE accesslevel=0"));

// All GM Characters
$gmchar=mysql_numrows(mysql_query("SELECT * FROM characters Where accesslevel > 0"));

// All Clan
$clan=mysql_numrows(mysql_query("SELECT * FROM clan_data"));

$gmnamesql = mysql_query("SELECT char_name FROM characters WHERE accesslevel>=1 AND online=1 ORDER BY char_name ASC");    
while ($gmnam = mysql_fetch_object($gmnamesql)) {  
$gmname .= "<font color=green>$gmnam->char_name</font>, ";  
}

print "
<table width='100%' border='0'>
<tr><td width='80%'><b>Auth Server:</b></td><td>".$ls."</td></tr>
<tr><td width='80%'><b>Bartz Server:</b></td><td>".$gs."</td></tr>
<tr><td width='80%'>Accounts:</td><td>".$accounts."</td></tr>
<tr><td width='80%'>Online Players:</td><td>".$num."</td></tr>
<tr><td width='80%'>Online GM:</td><td>".$gmnum."</td></tr>
<tr><td width='80%'>Characters:</td><td>".$char."</td></tr>
<tr><td width='80%'>GM Characters:</td><td>".$gmchar."</td></tr>
<tr><td width='80%'>Clans:</td><td>".$clan."</td></tr>
<tr><td width='80%'>Alliances:</td><td>".$alliance."</td></tr>
<tr><td>Online GM: ".$gmname."</td></tr>
</table>
";
////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////// Created By Mentor www.teamsrv.net ////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////

?>

  • 2 months later...
  • 2 weeks later...
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Posts

    • 🤖 Old Telegram bots with 2024 year old ⭐️ Good for search optimization TG ⭐️ Bots without subscribers ⭐️ Bots clean, no bans, blocking and complaints 💵 Price list: From 3 bots - 3$ for 1pc. From 20 bots - 2.5$ for 1pc. From 60 bots - 2.3$ for 1pc. From 100 bots - 2.2$ for 1pc. From 400 bots - 1.9$ for 1pc. 📌 To contact Us - t.me/smmtg6
    • ⚡️ Fast SEO optimization in Telegram for your channel/chat/bot. TOP OF SEARCH TG🔝 ✨ Effective solution for your business or blog. 🔥 Fast results within few days. ➡️ Contact us on Telegram for more details - t.me/smmtg6
    • 🤖⭐️ TELEGRAM PREMIUM BOT START: 1201ID - Ukraine 🇺🇦 + MIX | 7 Days Premium 🤖 - 3.4$ per 1000 1198 ID - Israel 🇮🇱 + Uzbekistan 🇺🇿 | Mix Days Premium 🤖 - 3.5$ per 1000 574 ID - Uzbekistan 🇺🇿 + Russia 🇷🇺 20% | 30-90 Days Premium 🤖 - 3.8$ per 1000 1210 ID - Ukraine 🇺🇦 + MIX | 7-30 Days Premium 🤖 | 4$ per 1000 1203 ID - Uzbekistan 🇺🇿 + MIX | 20-30 Days Premium 🤖 | 4$ per 1000 1195 ID - USA 🇺🇸 + Ukraine🇺🇦 + Canada 🇨🇦 | 15 Days Premium🤖 | 4.3$ per 1000 1213 ID - Uzbekistan 🇺🇿 + USA 🇺🇸 + Canada 🇨🇦 | 30 Days Premium 🤖 | 4.4$ per 1000 1202 ID - Uzbekistan 🇺🇿 + MIX | 30 Days Premium 🤖 | 4.4$ per 1000 752 ID - USA 🇺🇸 + China 🇨🇳 + Canada 🇨🇦 | 30 Days Premium 🤖 | 5.4$ per 1000 756 ID - Uzbekistan 🇺🇿 + Israel 🇮🇱 + Austria 🇦🇹 | 14-30 Days Premium 🤖 | &nbsp;5.6$ per 1000 758 ID - Canada 🇨🇦 + USA 🇺🇸 + Turkey 🇹🇷 | &nbsp;30 Days Premium 🤖 | 5.6$ per 1000 755 ID - Turkey 🇹🇷 + Egypt 🇪🇬 | 30-90 Days Premium 🤖 | 6$ per 1000 374 ID - Russia 🇷🇺 + USA 🇺🇸 + Canada 🇨🇦 | Mix Days Premium 🤖 | 6.8$ per 1000 741 ID - Ukraine 🇺🇦 + USA 🇺🇸 + Canada 🇨🇦 | 15-30 Days Premium 🤖 | 6.8$ per 1000 575 ID - USA 🇺🇸 + Russia 🇷🇺 + Canada 🇨🇦 | Mix Days Premium 🤖 | 7.2$ per 1000 372 ID - USA 🇺🇸 + Canada 🇨🇦 + Russia 🇷🇺 + EU 🇪🇺 | Mix Days Premium | 7.5$ per 1000 1204 ID - Ukraine 🇺🇦 + MIX | 60-90 Days Premium | 7.6$ per 1000
    • Make Maxcheaters Great Again? i suppose lmao    
  • Topics

×
×
  • Create New...