Pain
Member
- Feb 20, 2016
- 102
- 17
- 53
Wrong thread title
Hallo , i'm very noob with php, and i try to learn it, but i need help , i try to make a line with the status of my server :
and i create i file : status.php
---
i will a line so : Status: Online
someone know whats wrong with the code ?
Code:
<section class="hk_hero_section">
<!-- tiny header starts -->
<div class="hk_tiny_header tiny_header2">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="contact_email">
<span><i class="fa fa-clock-o"></i>24/7 Support</span><a href="tel:1234567890"><p>(123) 4567890</p></a> |
<span><i class=""></i>Status do Servidor: </span><?php include("teamspeak/status.php");?>
</div>
<div class="hk_contact_lang">
<ul>
<li class="hk_login_modal">
<a href="#"><span class="fa fa-lock"></span><p>Login</p></a>
<div class="login_modal_wrapper">
<form action="#">
<div class="hk_input_wrapper">
<input type="text" placeholder="Username">
<span class="fa fa-user"></span>
</div>
<div class="hk_input_wrapper">
<input type="password" placeholder="Password">
<span class="fa fa-lock"></span>
</div>
<p>Forget Password? <a href="#">Click Here</a></p>
<input class="hk_btn hk_login_btn" type="submit" value="Login Account">
</form>
</div>
</li>
<li class="lang">
<a href="#"><span class="lng">eng</span> <span class="caret"></span></a>
<ul class="hk_lang_dropdown">
<li><a href="#">English</a></li>
<li><a href="#">arabic</a></li>
<li><a href="#">German</a></li>
<li><a href="#">Spanish</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
and i create i file : status.php
Code:
<?php
// load framework library
require_once("../libraries/TeamSpeak3/TeamSpeak3.php"); // path to teamspeak framework
// data logging
$ts3_login="serveradmin"; // Login
$ts3_password="----"; // Password
$ts3_host="----"; // Server IP adress
$ts3_queryport="10011"; // query port (default 10011)
$ts3_voiceport="9009"; // voice port (default 9987)
try {
//connect serverquery.
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://$serverquery_username:$serverquery_pass@$serverip:$serverquery_port/?server_port=$serverport");
echo "Online </br>";
echo "Slots: ".$ts3_VirtualServer->virtualserver_clientsonline." / ".$ts3_VirtualServer->virtualserver_maxclients;
}
catch(Exception $e){
// grab errors and show server as offline
echo "Offline";
}
}
// check error
catch(Exception $e){
echo "<p class='server_error'> ERROR: </p>" , $e->getMessage(), "\n";
}
?>
i will a line so : Status: Online
someone know whats wrong with the code ?
Last edited: