Thanks man, greatly apprecaited.I'll do it. Will be done soon
Do you want to see if the client is online without the page reloading? It would need JQuery for that.Thanks man, greatly apprecaited.
Do you want to see if the client is online without the page reloading? It would need JQuery for that.
Otherwise it will reload the page and then show if the client is online.
<?php
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
$ts3 = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011/?server_port=9987");
$user = $ts3->clientGetByUid("bWvZD4osfd/c1sN4YHTz8ApoJE=");
if($user["client_type"]) continue;
echo "<strong><a style='color:#19D119;'>" . $user . "</strong> - Online on TeamSpeak" . "</a><br>" ;
}
?>
<?php
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
$ts3 = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011/?server_port=9987");
try{
$client = $ts3->clientGetByUid("GV1o/OG88OpRoTwTq4HOA3BCEic=");
//If no error occured echo online, means client is online
echo "online";
}
catch(TeamSpeak3_Exception $error)
{
//Check if error is invalidID and echo offline, means offline or wrong uid
if($error->getCode() == 512){
die("offline");
}
// print the error message returned by the server
echo "Error " . $error->getCode() . ": " . $error->getMessage();
}
$uid = "GV1o/OG88OpRoTwTq4HOA3BCEic=";
$dbid = $ts3->clientFindDb($uid, true)[0];
$ts3->serverGroupClientAdd(21, $dbid);
<?php require_once("libraries/TeamSpeak3/TeamSpeak3.php"); $ts3 = TeamSpeak3::factory("serverquery://serveradmin[email protected]:10011/?server_port=9987"); try{ $client = $ts3->clientGetByUid("GV1o/OG88OpRoTwTq4HOA3BCEic="); //If no error occured echo online, means client is online echo "online"; } catch(TeamSpeak3_Exception $error) { //Check if error is invalidID if($error->getCode() == 512){ echo "offline"; die(); } // print the error message returned by the server echo "Error " . $error->getCode() . ": " . $error->getMessage(); }
<?php
if(isset($_POST['submit']))
{
$filename = 'TeamSpeak3/TeamSpeak3.php';
if (file_exists($filename))
{
require_once("TeamSpeak3/TeamSpeak3.php");
}
else
{
die ("The file $filename does not exist");
}
$login_name = 'serveradmin'; //query login info
$login_password = '7mJEDtKf'; // =||=
$ip = 'localhost'; //ex. 127.0.0.1/ 254.13.121.12
$query_port = '10011'; //default 10011
$virtualserver_port = '9987'; //default 9987
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://".$login_name.":".$login_password."@".$ip.":".$query_port."/?server_port=".$virtualserver_port."&nickname=R4P3&blocking=0");
$uid = $_POST['uid'];
try{
$client = $ts3_VirtualServer->clientGetByUid($uid);
//If no error occured echo online, means client is online
echo "online";
}
catch(TeamSpeak3_Exception $error)
{
//Check if error is invalidID
if($error->getCode() == 512){
echo "offline";
die();
}
// print the error message returned by the server
echo "Error " . $error->getCode() . ": " . $error->getMessage();
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>ID FINDER</title>
</head>
<body>
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" method="POST">
<input placeholder="Post your uid" type="text" name="uid" /><br>
<button type="submit" name="submit"><strong>Search</strong></button>
</form>
</body>
</html>
Look in your error log. Maybe the path to the teamspeak framework is wrong?That would be perfect for what I needed, but I don't know why .. it is displaying a HTTP ERROR 500 being alone without any other piece of code.
[Sat Dec 09 22:57:58.372714 2017] [:error] [pid 3732] [client 162.158.79.165:34659] PHP Fatal error: Uncaught TeamSpeak3_Adapter_ServerQuery_Exception: connection failed, you are banned (you may retry in 161 seconds) in /var/www/html/n/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php:319\nStack trace:\n#0 /var/www/html/n/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php(91): TeamSpeak3_Adapter_ServerQuery_Reply->fetchError(Object(TeamSpeak3_Helper_String))\n#1 /var/www/html/n/libraries/TeamSpeak3/Adapter/ServerQuery.php(141): TeamSpeak3_Adapter_ServerQuery_Reply->__construct(Array, 'login client_lo...', Object(TeamSpeak3_Node_Host), true)\n#2 /var/www/html/n/libraries/TeamSpeak3/Node/Abstract.php(73): TeamSpeak3_Adapter_ServerQuery->request('login client_lo...', true)\n#3 /var/www/html/n/libraries/TeamSpeak3/Node/Abstract.php(97): TeamSpeak3_Node_Abstract->request('login client_lo...')\n#4 /var/www/html/n/libraries/TeamSpeak3/Node/Host.php(839): TeamSpeak3_Node_Abstract->execute('login', Array)\n#5 /var/www/html/n/libraries/TeamSpeak3/TeamSpeak3.php(328): TeamSpeak3_Node_Host->login(Object(TeamSpeak3_Helper_Stri in /var/www/html/n/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php on line 319
[Sat Dec 09 22:58:04.323579 2017] [:error] [pid 3741] [client 141.101.107.172:12369] PHP Fatal error: Uncaught TeamSpeak3_Adapter_ServerQuery_Exception: connection failed, you are banned (you may retry in 155 seconds) in /var/www/html/n/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php:319\nStack trace:\n#0 /var/www/html/n/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php(91): TeamSpeak3_Adapter_ServerQuery_Reply->fetchError(Object(TeamSpeak3_Helper_String))\n#1 /var/www/html/n/libraries/TeamSpeak3/Adapter/ServerQuery.php(141): TeamSpeak3_Adapter_ServerQuery_Reply->__construct(Array, 'login client_lo...', Object(TeamSpeak3_Node_Host), true)\n#2 /var/www/html/n/libraries/TeamSpeak3/Node/Abstract.php(73): TeamSpeak3_Adapter_ServerQuery->request('login client_lo...', true)\n#3 /var/www/html/n/libraries/TeamSpeak3/Node/Abstract.php(97): TeamSpeak3_Node_Abstract->request('login client_lo...')\n#4 /var/www/html/n/libraries/TeamSpeak3/Node/Host.php(839): TeamSpeak3_Node_Abstract->execute('login', Array)\n#5 /var/www/html/n/libraries/TeamSpeak3/TeamSpeak3.php(328): TeamSpeak3_Node_Host->login(Object(TeamSpeak3_Helper_Stri in /var/www/html/n/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php on line 319, referer: http://maxskill.eu/n/test.php
$ts3 = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011/?server_port=9987");
Oh yea try putting theinside the "try". Then it would echo "error you are banned retry in.."PHP:$ts3 = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011/?server_port=9987");
I added simple html form to check uids with @Kieran php code
PHP:<?php if(isset($_POST['submit'])) { $filename = 'TeamSpeak3/TeamSpeak3.php'; if (file_exists($filename)) { require_once("TeamSpeak3/TeamSpeak3.php"); } else { die ("The file $filename does not exist"); } $login_name = 'serveradmin'; //query login info $login_password = '7mJEDtKf'; // =||= $ip = 'localhost'; //ex. 127.0.0.1/ 254.13.121.12 $query_port = '10011'; //default 10011 $virtualserver_port = '9987'; //default 9987 $ts3_VirtualServer = TeamSpeak3::factory("serverquery://".$login_name.":".$login_password."@".$ip.":".$query_port."/?server_port=".$virtualserver_port."&nickname=R4P3&blocking=0"); $uid = $_POST['uid']; try{ $client = $ts3_VirtualServer->clientGetByUid($uid); //If no error occured echo online, means client is online echo "online"; } catch(TeamSpeak3_Exception $error) { //Check if error is invalidID if($error->getCode() == 512){ echo "offline"; die(); } // print the error message returned by the server echo "Error " . $error->getCode() . ": " . $error->getMessage(); } } ?> <!DOCTYPE html> <html> <head> <title>ID FINDER</title> </head> <body> <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" method="POST"> <input placeholder="Post your uid" type="text" name="uid" /><br> <button type="submit" name="submit"><strong>Search</strong></button> </form> </body> </html>
Liking the most helping posts is enough :3Thank you so much to the both of you..
Greatly Appreciated.. Is there any way I can add reputation or something like that to show my gratitude?