PHP server status & information[+rep]
#1

Hello, i downloaded High Defenition website template and i wanted to add the server status(players online,gamemode,ip etc) on the website but how to do it?is there any program or code for that?thank you
Reply
#2

You can get the server info with this code by Westie: Click me
Reply
#3

This is probably what you are searching for...
https://sampforum.blast.hk/showthread.php?tid=301435
Reply
#4

the first one is right i guess but i dont understand much about PHP,so can someone help me creating it?
i didnt get very far with that

thats the code
Код:
<div class="news_holder">
        	<div class="news_top"></div>
            <div class="news">
            <img src="images/news_bulletin.png" alt="" />
            <h1>Welcome to our new website</h1>
            <p>Our website is currently under developement,the login/register system ain't working right now.</p>
            <p>Server updates are up at the forums.</p>
            <p>Regards,<br />Luca Salerino</p>
            </div>
            <div class="news_bottom"></div>
            <!--Please do not remove this copyright-->
			<div class="copyright">Designed by <a href="http://www.zasprexstudios.com/">Zasprex Studios</a> &amp; Coded by <a href="http://www.fredricksw.com/">FredrickSW & Viswanath</a></div>
            <!--Please do not remove this copyright-->
        </div>
        <div class="right_holder">
        	<div class="login_box">
            	<div class="righ_top"></div>
                <div class="right_middle">
                	<img class="login_img" src="images/login_img.png" alt="" />
                    <div class="login_text">
                    <input class="textfield" name="username" type="text" placeholder="Username" />
                    <input class="password textfield" name="password" type="password" placeholder="Password" />
                    </div>
                    <div class="login_btn">
                    <a href="#"><img src="images/login_btn.png" border="0" alt="" /></a>
                    </div>
                </div>
                <div class="right_bottom"></div>
            </div>
            <div class="stats_box">
            	<div class="statsrigh_top"></div>
                <div class="statsright_middle">
                	<img class="stats_img" src="images/stats.png" alt="" />
                    Server: Online<br />
                    Server IP: 127.0.0.1<br />
                    Port: 7777<br />
                    Players: 0/49<br />
                    Mode: MP-RP v.1000<br />
                    Map: San Andreas<br />
                </div>
Reply
#5

bump!

i tried this way:
Код:
<?php
require "SampQueryAPI.php";
$query = new SampQueryAPI('80.79.113.13', '7777');
$aInformation = $query->getInfo();
?>

<div class="news_holder">
        	<div class="news_top"></div>
            <div class="news">
            <img src="images/news_bulletin.png" alt="" />
            <h1>Welcome to our new website</h1>
            <p>Our website is currently under developement,the login/register system ain't working right now.</p>
            <p>Server updates are up at the forums.</p>
            <p>Regards,<br />Luca Salerino</p>
            </div>
            <div class="news_bottom"></div>
            <!--Please do not remove this copyright-->
			<div class="copyright">Designed by <a href="http://www.zasprexstudios.com/">Zasprex Studios</a> &amp; Coded by <a href="http://www.fredricksw.com/">FredrickSW & Viswanath</a></div>
            <!--Please do not remove this copyright-->
        </div>
        <div class="right_holder">
        	<div class="login_box">
            	<div class="righ_top"></div>
                <div class="right_middle">
                	<img class="login_img" src="images/login_img.png" alt="" />
                    <div class="login_text">
                    <input class="textfield" name="username" type="text" placeholder="Username" />
                    <input class="password textfield" name="password" type="password" placeholder="Password" />
                    </div>
                    <div class="login_btn">
                    <a href="#"><img src="images/login_btn.png" border="0" alt="" /></a>
                    </div>
                </div>
                <div class="right_bottom"></div>
            </div>
            <div class="stats_box">
            	<div class="statsrigh_top"></div>
                <div class="statsright_middle">
                	<img class="stats_img" src="images/stats.png" alt="" />
                    <?= htmlentities($aInformation['hostname']) ?><br />
                    Server: Online<br />
                    Server IP: 80.79.113.13:7777<br />
                    Players: <?= $aInformation['players'] ?> / <?= $aInformation['maxplayers'] ?><br />
                    Mode: <?= htmlentities($aInformation['gamemode']) ?><br />
                    Map: <?= htmlentities($aInformation['mapname']) ?><br />
                </div>
but it wont show anything at the players mode map hostname etc
Reply
#6

The most of this code is written in HTML and CSS. If you don't know anything about them, then you should go and learn these languages! We ain't here to explain you the whole webdesign! Here are tons of users which have such a signature as yiu want, so go for it! You could also search for a javascript in ******...
Reply
#7

Twisted is right. You should learn almost the BASICS of the language your going to use. Plus you have to use Server Query but before learn HTML, PHP aswell.
Reply
#8

so no one cant help me by making tut or smth?
Reply
#9

Quote:
Originally Posted by WardenCS
Посмотреть сообщение
so no one cant help me by making tut or smth?
You have to use Server Query by Waste.
Reply
#10

Quote:
Originally Posted by WardenCS
Посмотреть сообщение
bump!

i tried this way:
Код:
<?php
require "SampQueryAPI.php";
$query = new SampQueryAPI('80.79.113.13', '7777');
$aInformation = $query->getInfo();
?>

<div class="news_holder">
        	<div class="news_top"></div>
            <div class="news">
            <img src="images/news_bulletin.png" alt="" />
            <h1>Welcome to our new website</h1>
            <p>Our website is currently under developement,the login/register system ain't working right now.</p>
            <p>Server updates are up at the forums.</p>
            <p>Regards,<br />Luca Salerino</p>
            </div>
            <div class="news_bottom"></div>
            <!--Please do not remove this copyright-->
			<div class="copyright">Designed by <a href="http://www.zasprexstudios.com/">Zasprex Studios</a> &amp; Coded by <a href="http://www.fredricksw.com/">FredrickSW & Viswanath</a></div>
            <!--Please do not remove this copyright-->
        </div>
        <div class="right_holder">
        	<div class="login_box">
            	<div class="righ_top"></div>
                <div class="right_middle">
                	<img class="login_img" src="images/login_img.png" alt="" />
                    <div class="login_text">
                    <input class="textfield" name="username" type="text" placeholder="Username" />
                    <input class="password textfield" name="password" type="password" placeholder="Password" />
                    </div>
                    <div class="login_btn">
                    <a href="#"><img src="images/login_btn.png" border="0" alt="" /></a>
                    </div>
                </div>
                <div class="right_bottom"></div>
            </div>
            <div class="stats_box">
            	<div class="statsrigh_top"></div>
                <div class="statsright_middle">
                	<img class="stats_img" src="images/stats.png" alt="" />
                    <?= htmlentities($aInformation['hostname']) ?><br />
                    Server: Online<br />
                    Server IP: 80.79.113.13:7777<br />
                    Players: <?= $aInformation['players'] ?> / <?= $aInformation['maxplayers'] ?><br />
                    Mode: <?= htmlentities($aInformation['gamemode']) ?><br />
                    Map: <?= htmlentities($aInformation['mapname']) ?><br />
                </div>
but it wont show anything at the players mode map hostname etc
that code aint right?what i have to add?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)