Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*-------SETTINGS-------*/ //PLEASE EDIT THIS PART
- $ts3_ip = '127.0.0.1';
- $ts3_queryport = 10011;
- $ts3_user = 'serveradmin';
- $ts3_pass = 'NASRAT';
- $ts3_port = 9987;
- /*----------------------*/
- #Include ts3admin.class.php
- require("ts3admin.class.php");
- #build a new ts3admin object
- $tsAdmin = new ts3admin($ts3_ip, $ts3_queryport);
- function array2table($array) {
- $html = '';
- $html .= '<table cellpadding="5" cellspacing="1" bgcolor="black" align="center" width="';
- $html .= '400px">';
- $html .= '<tr>';
- $html .= '<td bgcolor="#c0c0c0" style="font-weight:bold" align="center">Key</td>';
- $html .= '<td bgcolor="#c0c0c0" style="font-weight:bold" align="center">Value</td>';
- $html .= '</tr>';
- foreach($array as $key => $value) {
- $html .= '<tr>';
- $html .= '<td bgcolor="red" align="center">'.htmlspecialchars($key).'</td>';
- $html .= '<td bgcolor="#ffffff" align="center">'.htmlspecialchars($value).'</td>';
- $html .= '</tr>';
- }
- return $html;
- }
- $html = '';
- if($tsAdmin->getElement('success', $tsAdmin->connect()))
- {
- #login as serveradmin
- $tsAdmin->login($ts3_user, $ts3_pass);
- #select teamspeakserver
- $tsAdmin->selectServer($ts3_port);
- $customFieldSet = array();
- $output = $tsAdmin->tokenAdd('0','7','0','registrationtoken',$customFieldSet);
- $html = array2table($output['data']);
- }
- else
- {
- echo 'Connection could not be established.';
- }
- ?>
- <html>
- <head>
- </head>
- <body>
- <?php echo $html; ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment