Simple & Clean Server Creator [Web]

EscuderoKevin

Active Member
Joined
Jul 2, 2015
Messages
404
Points
90
Age
26
Location
Argentina
Hi, i made this for r4p3.

Features:

  • Server Name
  • Server Slots
  • Server Port (If form blank, i use random port)
  • When Server Created Show Token ServerAdmin
  • When Server Created Show Server Port.
  • When Server Created Show Name
To Do List:
  • Add reCAPTCHA Verification
Edit data/config.php
And Test.

Download:
You do not have permission to view link Log in or register now.

Virustotal: 0 / 67
You do not have permission to view link Log in or register now.


Github:
You do not have permission to view link Log in or register now.

Index Form.


Server Created:


In Phonetic Name I put Time and Hour when its created:


index.php
PHP:
<?php
    date_default_timezone_set('America/Argentina/Buenos_Aires'); //Change Here!
    require_once("libraries/TeamSpeak3/TeamSpeak3.php");
    include 'data/config.php';


    $connect = "serverquery://".$USER_QUERY.":".$PASS_QUERY."@".$HOST_QUERY.":".$PORT_QUERY."";
    $ts3 = TeamSpeak3::factory($connect);

    if (isset($_POST["create"])) {

        $servername = $_POST['servername'];
        $slots = $_POST['slots'];
        $unixTime = time();
        $realTime = date('[Y-m-d]-[H:i]',$unixTime);

        if(!empty($_POST['port'])) {
 
            $port = $_POST['port'];
            try
            {
                $new_ts3 = $ts3->serverCreate(array(
                "virtualserver_name" => $servername,
                "virtualserver_maxclients" => $slots,
                "virtualserver_port" => $port,
                "virtualserver_name_phonetic" => $realTime,
                "virtualserver_hostbutton_tooltip" => "My Company",
                "virtualserver_hostbutton_url" => "http://www.example.com",
                "virtualserver_hostbutton_gfx_url" => "http://www.example.com/buttons/button01_24x24.jpg",
                ));
     
                $token = $new_ts3['token'];
     
            }
            catch(Exception $e)
            {
                echo "Error (ID " . $e->getCode() . ") <b>" . $e->getMessage() . "</b>";
            }
            } else{
 
            try
            {
                $new_ts3 = $ts3->serverCreate(array(
                "virtualserver_name" => $servername,
                "virtualserver_maxclients" => $slots,
                "virtualserver_name_phonetic" => $realTime,
                "virtualserver_hostbutton_tooltip" => "My Company",
                "virtualserver_hostbutton_url" => "http://www.example.com",
                "virtualserver_hostbutton_gfx_url" => "http://www.example.com/buttons/button01_24x24.jpg",
                ));
     
                $token = $new_ts3['token'];
                $portran = $new_ts3['virtualserver_port'];
     
            }
            catch(Exception $e)
            {
                echo "Error (ID " . $e->getCode() . ") <b>" . $e->getMessage() . "</b>";
            }
 
        }


    }
?>
<!DOCTYPE html>
<html lang="en" class="no-js">
    <head>
        <meta charset="UTF-8" />
        <title>Simple Channel Create</title>
        <link rel="stylesheet" type="text/css" href="css/demo.css" />
        <link rel="stylesheet" type="text/css" href="css/style.css" />
        <link rel="stylesheet" type="text/css" href="css/animate-custom.css" />
    </head>
    <body>
        <div class="container">
            <header>
                <h1>Simple Server<span> Creator</span></h1>
            </header>
            <section>     
                <div id="container_demo" >
                    <div id="wrapper">
                        <div id="login" class="animate form">
                            <?php
                                if (isset($_POST["create"])) {
                                ?>
                                <form  method="post" autocomplete="off">
                         
                                    <h1>Server Created!</h1>
                         
                                    <p>
                                        <label  class="uname" data-icon="u" > Server Name</label>
                                        <input readonly type="text" value="<?php echo $servername; ?>"/>
                                    </p>
                         
                                    <p>
                                        <label  class="uname" data-icon="u" > Token</label>
                                        <input readonly type="text" value="<?php echo $token; ?>"/>
                                    </p>
                         
                                    <p>
                                        <label  class="uname" data-icon="u" > Server Port</label>
                                        <input readonly type="text" value="<?php if(!empty($_POST['port'])) { echo $port; } else{ echo $portran; }  ?>"/>
                                    </p>
                         
                                </form>
                     
                                <?php }
                                else{
                                ?>
                                <form  method="post" autocomplete="off">
                                    <h1>Settings</h1>
                                    <p>
                                        <label  class="uname" data-icon="u" > Server Name</label>
                                        <input  name="servername" required="required" type="text" placeholder="Server Name"/>
                                    </p>
                         
                                    <p>
                                        <label class="youpasswd" data-icon="p"> Slots</label>
                                        <input name="slots" required="required" type="text" placeholder="100" />
                                    </p>
                         
                                    <p>
                                        <label class="youpasswd" data-icon="p"> Port</label>
                                        <input name="port" type="text" placeholder="9987 or blank for random" />
                                    </p>
                         
                                    <p class="login button">
                                        <input type="submit" name="create" value="Create!" />
                                    </p>
                                </form>
                            <?php } ?>
                        </div>
             
                    </div>
                </div>
            </section>
            <footer>
                <h1>Created By<span> EscuderoKevin</span> For <span> R4P3.NET </span></h1>
            </footer>
        </div>
    </body>
</html>
config.php

PHP:
<?php

$HOST_QUERY = "xxxxxx";
$PORT_QUERY = "10011";
$USER_QUERY = "serveradmin";
$PASS_QUERY = "xxxxx";
$NICK_QUERY = "xxxxx";


?>


Code:
Changelog.

# Created Script
# Fix Bugs
# Removed /?server_port=".$SERVER_PORT."
# Removed $ts3->execute("clientupdate", array("client_nickname" => $NICK_QUERY));
 
Last edited by a moderator:

Alligatoras

Administrator
Joined
Mar 31, 2016
Messages
2,090
Points
326
Age
25
Location
Greece
Hi, i made this for r4p3.

Features:

  • Server Name
  • Server Slots
  • Server Port (If form blank, i use random port)
  • When Server Created Show Token ServerAdmin
  • When Server Created Show Server Port.
  • When Server Created Show Name
To Do List:
  • Add reCAPTCHA Verification

And Test.

Download:
You do not have permission to view link Log in or register now.


VirusTotal:

Index Form.


Server Created:


In Phonetic Name I put Time and Hour when its created:


index.php
PHP:
<?php
    date_default_timezone_set('America/Argentina/Buenos_Aires'); //Change Here!
    require_once("libraries/TeamSpeak3/TeamSpeak3.php");
    include 'data/config.php';


    $connect = "serverquery://".$USER_QUERY.":".$PASS_QUERY."@".$HOST_QUERY.":".$PORT_QUERY."/?server_port=".$SERVER_PORT."";
    $ts3 = TeamSpeak3::factory($connect);
    $ts3->execute("clientupdate", array("client_nickname" => $NICK_QUERY));

    if (isset($_POST["create"])) {
    
        $servername = $_POST['servername'];
        $slots = $_POST['slots'];
        $unixTime = time();
        $realTime = date('[Y-m-d]-[H:i]',$unixTime);
    
        if(!empty($_POST['port'])) {
        
            $port = $_POST['port'];
            try
            {
                $new_ts3 = $ts3->serverCreate(array(
                "virtualserver_name" => $servername,
                "virtualserver_maxclients" => $slots,
                "virtualserver_port" => $port,
                "virtualserver_name_phonetic" => $realTime,
                "virtualserver_hostbutton_tooltip" => "My Company",
                "virtualserver_hostbutton_url" => "http://www.example.com",
                "virtualserver_hostbutton_gfx_url" => "http://www.example.com/buttons/button01_24x24.jpg",
                ));
            
                $token = $new_ts3['token'];
            
            }
            catch(Exception $e)
            {
                echo "Error (ID " . $e->getCode() . ") <b>" . $e->getMessage() . "</b>";
            }
            } else{
        
            try
            {
                $new_ts3 = $ts3->serverCreate(array(
                "virtualserver_name" => $servername,
                "virtualserver_maxclients" => $slots,
                "virtualserver_name_phonetic" => $realTime,
                "virtualserver_hostbutton_tooltip" => "My Company",
                "virtualserver_hostbutton_url" => "http://www.example.com",
                "virtualserver_hostbutton_gfx_url" => "http://www.example.com/buttons/button01_24x24.jpg",
                ));
            
                $token = $new_ts3['token'];
                $portran = $new_ts3['virtualserver_port'];
            
            }
            catch(Exception $e)
            {
                echo "Error (ID " . $e->getCode() . ") <b>" . $e->getMessage() . "</b>";
            }
        
        }
    
    
    }
?>
<!DOCTYPE html>
<html lang="en" class="no-js">
    <head>
        <meta charset="UTF-8" />
        <title>Simple Channel Create</title>
        <link rel="stylesheet" type="text/css" href="css/demo.css" />
        <link rel="stylesheet" type="text/css" href="css/style.css" />
        <link rel="stylesheet" type="text/css" href="css/animate-custom.css" />
    </head>
    <body>
        <div class="container">
            <header>
                <h1>Simple Server<span> Creator</span></h1>
            </header>
            <section>            
                <div id="container_demo" >
                    <div id="wrapper">
                        <div id="login" class="animate form">
                            <?php
                                if (isset($_POST["create"])) {
                                ?>
                                <form  method="post" autocomplete="off">
                                
                                    <h1>Server Created!</h1>
                                
                                    <p>
                                        <label  class="uname" data-icon="u" > Server Name</label>
                                        <input readonly type="text" value="<?php echo $servername; ?>"/>
                                    </p>
                                
                                    <p>
                                        <label  class="uname" data-icon="u" > Token</label>
                                        <input readonly type="text" value="<?php echo $token; ?>"/>
                                    </p>
                                
                                    <p>
                                        <label  class="uname" data-icon="u" > Server Port</label>
                                        <input readonly type="text" value="<?php if(!empty($_POST['port'])) { echo $port; } else{ echo $portran; }  ?>"/>
                                    </p>
                                
                                </form>
                            
                                <?php }
                                else{
                                ?>
                                <form  method="post" autocomplete="off">
                                    <h1>Settings</h1>
                                    <p>
                                        <label  class="uname" data-icon="u" > Server Name</label>
                                        <input  name="servername" required="required" type="text" placeholder="Server Name"/>
                                    </p>
                                
                                    <p>
                                        <label class="youpasswd" data-icon="p"> Slots</label>
                                        <input name="slots" required="required" type="text" placeholder="100" />
                                    </p>
                                
                                    <p>
                                        <label class="youpasswd" data-icon="p"> Port</label>
                                        <input name="port" type="text" placeholder="9987 or blank for random" />
                                    </p>
                                
                                    <p class="login button">
                                        <input type="submit" name="create" value="Create!" />
                                    </p>
                                </form>
                            <?php } ?>
                        </div>
                    
                    </div>
                </div>
            </section>
            <footer>
                <h1>Created By<span> EscuderoKevin</span> For <span> R4P3.NET </span></h1>
            </footer>
        </div>
    </body>
</html>
config.php

PHP:
<?php

$HOST_QUERY = "xxxxxx";
$PORT_QUERY = "10011";
$USER_QUERY = "serveradmin";
$PASS_QUERY = "xxxxx";
$NICK_QUERY = "xxxxx";


?>
WoW.... :)

Very nice job @EscuderoKevin :D
Thank you for creating this beautiful stuff for our community members :D
 

mkll11one

Active Member
Joined
Apr 26, 2016
Messages
191
Points
74
Age
26
Location
Denmark, Copenhagen
@EscuderoKevin
Are it's possible for add some "feature" so it's just only possible to create 1 ts3server per "visitor IP" ?

I forget to write i found some errors.
Where can i sent it (without to spam the thread/forum) ;)
 
Last edited:

EscuderoKevin

Active Member
Joined
Jul 2, 2015
Messages
404
Points
90
Age
26
Location
Argentina
@EscuderoKevin
Are it's possible for add some "feature" so it's just only possible to create 1 ts3server per "visitor IP" ?

I forget to write i found some errors.
Where can i sent it (without to spam the thread/forum) ;)

repry to this thread for errors in this script.

Yep its possible... but , when your ip change ? what happend (? xd
 

mkll11one

Active Member
Joined
Apr 26, 2016
Messages
191
Points
74
Age
26
Location
Denmark, Copenhagen
The errors is:
- New error found (edited)
Code:
Fatal error: Uncaught exception 'TeamSpeak3_Adapter_ServerQuery_Exception' with message 'convert error' in /home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php:319 Stack trace: #0 /home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php(91): TeamSpeak3_Adapter_ServerQuery_Reply->fetchError(Object(TeamSpeak3_Helper_String)) #1 /home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Adapter/ServerQuery.php(141): TeamSpeak3_Adapter_ServerQuery_Reply->__construct(Array, 'use port=', Object(TeamSpeak3_Node_Host), true) #2 /home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Node/Abstract.php(73): TeamSpeak3_Adapter_ServerQuery->request('use port=', true) #3 /home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Node/Abstract.php(97): TeamSpeak3_Node_Abstract->request('use port=') #4 /home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Node/Host.php(185): TeamSpeak3_Node_Abstract->execute('use', Array) #5 /home/mikkel/public in /home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php on line 319
What to do? :D
 

EscuderoKevin

Active Member
Joined
Jul 2, 2015
Messages
404
Points
90
Age
26
Location
Argentina
In config , you need put IP , not DNS. Sometimes happens that hangs api, I usually spend a lot lately not solve either the dns

Anyway, test this:

change:
PHP:
$connect = "serverquery://".$USER_QUERY.":".$PASS_QUERY."@".$HOST_QUERY.":".$PORT_QUERY."/?server_port=".$SERVER_PORT."";
--------->

PHP:
$connect = "serverquery://".$USER_QUERY.":".$PASS_QUERY."@".$HOST_QUERY.":".$PORT_QUERY."";
 

mkll11one

Active Member
Joined
Apr 26, 2016
Messages
191
Points
74
Age
26
Location
Denmark, Copenhagen
After i did update the $connect you writed.
Code:
Fatal error: Uncaught exception 'TeamSpeak3_Adapter_ServerQuery_Exception' with message 'invalid serverID' in /home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php:319
Stack trace: #0 /home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php(91): TeamSpeak3_Adapter_ServerQuery_Reply->fetchError(Object(TeamSpeak3_Helper_String)) #1 

/home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Adapter/ServerQuery.php(141): TeamSpeak3_Adapter_ServerQuery_Reply->__construct(Array, 'clientupdate cl...', Object(TeamSpeak3_Node_Host), true) #2 

/home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Node/Abstract.php(73): TeamSpeak3_Adapter_ServerQuery->request('clientupdate cl...', true) #3 

/home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Node/Abstract.php(97): TeamSpeak3_Node_Abstract->request('clientupdate cl...') #4 /home/mikkel/public_html/test/ts3/index.php(9): 

TeamSpeak3_Node_Abstract->execute('clientupdate', Array) #5 {main} in /home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php on line 319
 

EscuderoKevin

Active Member
Joined
Jul 2, 2015
Messages
404
Points
90
Age
26
Location
Argentina
After i did update the $connect you writed.
Code:
Fatal error: Uncaught exception 'TeamSpeak3_Adapter_ServerQuery_Exception' with message 'invalid serverID' in /home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php:319
Stack trace: #0 /home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php(91): TeamSpeak3_Adapter_ServerQuery_Reply->fetchError(Object(TeamSpeak3_Helper_String)) #1

/home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Adapter/ServerQuery.php(141): TeamSpeak3_Adapter_ServerQuery_Reply->__construct(Array, 'clientupdate cl...', Object(TeamSpeak3_Node_Host), true) #2

/home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Node/Abstract.php(73): TeamSpeak3_Adapter_ServerQuery->request('clientupdate cl...', true) #3

/home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Node/Abstract.php(97): TeamSpeak3_Node_Abstract->request('clientupdate cl...') #4 /home/mikkel/public_html/test/ts3/index.php(9):

TeamSpeak3_Node_Abstract->execute('clientupdate', Array) #5 {main} in /home/mikkel/public_html/test/ts3/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php on line 319
Remove
PHP:
$ts3->execute("clientupdate", array("client_nickname" => $NICK_QUERY));
 

mkll11one

Active Member
Joined
Apr 26, 2016
Messages
191
Points
74
Age
26
Location
Denmark, Copenhagen
Fixed! ;) - it works now.

Are it's possible to add "Server IP" after click "created"
Example:
Server Name
Tokens
Server Port
<and here add: Server IP> <<
 

EscuderoKevin

Active Member
Joined
Jul 2, 2015
Messages
404
Points
90
Age
26
Location
Argentina
Fixed! ;) - it works now.

Are it's possible to add "Server IP" after click "created"
Example:
Server Name
Tokens
Server Port
<and here add: Server IP> <<
Sure

Edit index.php

PHP:
                                    <p>
                                        <label  class="uname" data-icon="u" > Token</label>
                                        <input readonly type="text" value="<?php echo $token; ?>"/>
                                    </p>
                                   
                                    <p>
                                        <label  class="uname" data-icon="u" > Server IP</label>
                                        <input readonly type="text" value="<?php echo $HOST_QUERY; ?>"/>
                                    </p>
                                   
                                    <p>
                                        <label  class="uname" data-icon="u" > Server Port</label>
                                        <input readonly type="text" value="<?php if(!empty($_POST['port'])) { echo $port; } else{ echo $portran; }  ?>"/>
                                    </p>
 

Pain

Member
Joined
Feb 20, 2016
Messages
140
Points
53
Age
24
Location
Netherlands
OMFG , what a nice work @EscuderoKevin ! Thank you so much !
Someone know if the user can create with dns , not the ip , because some people do ddos atack
 
Last edited:

Pain

Member
Joined
Feb 20, 2016
Messages
140
Points
53
Age
24
Location
Netherlands
Change in config.php $HOST_QUERY to DNS -.-
But @EscuderoKevin , you can be exact , i don't understand ,
<?php
$HOST_QUERY = "xxxxxx"; --> what should I write here then ? example if i have domain " example.com " , how the user can create = ts.example.com ? ,
or what I should write?

$PORT_QUERY = "10011";
$USER_QUERY = "serveradmin";
$PASS_QUERY = "xxxxx";
$NICK_QUERY = "xxxxx";
?>
Thank you for you help !
 

EscuderoKevin

Active Member
Joined
Jul 2, 2015
Messages
404
Points
90
Age
26
Location
Argentina
But @EscuderoKevin , you can be exact , i don't understand ,
<?php
$HOST_QUERY = "xxxxxx"; --> what should I write here then ? example if i have domain " example.com " , how the user can create = ts.example.com ? ,
or what I should write?

$PORT_QUERY = "10011";
$USER_QUERY = "serveradmin";
$PASS_QUERY = "xxxxx";
$NICK_QUERY = "xxxxx";
?>
Thank you for you help !

$HOST_QUERY = "xxxxxx"; ip or dns -.-

ex.
$HOST_QUERY = "127.0.0.1";
or
$HOST_QUERY = "ts.r4p3.net";

You can modify to index.php

PHP:
                                    <p>
                                        <label  class="uname" data-icon="u" > Server IP</label>
                                        <input readonly type="text" value="<?php echo $HOST_QUERY; ?>"/>
                                    </p>
to

PHP:
                                    <p>
                                        <label  class="uname" data-icon="u" > Server IP</label>
                                        <input readonly type="text" value="TS.R4P3.NET"/>
                                    </p>
 

Pain

Member
Joined
Feb 20, 2016
Messages
140
Points
53
Age
24
Location
Netherlands
$HOST_QUERY = "xxxxxx"; ip or dns -.-

ex.
$HOST_QUERY = "127.0.0.1";
or
$HOST_QUERY = "ts.r4p3.net";

You can modify to index.php

PHP:
                                    <p>
                                        <label  class="uname" data-icon="u" > Server IP</label>
                                        <input readonly type="text" value="<?php echo $HOST_QUERY; ?>"/>
                                    </p>
to

PHP:
                                    <p>
                                        <label  class="uname" data-icon="u" > Server IP</label>
                                        <input readonly type="text" value="TS.R4P3.NET"/>
                                    </p>
but if i create, the result is = ts.mydomain.com , and if other user create he's result is too = ts.mydomain.com

can i reduce the slot's, the person can create up to 100 slots
 
Last edited:

Alligatoras

Administrator
Joined
Mar 31, 2016
Messages
2,090
Points
326
Age
25
Location
Greece
but if i create, the result is = ts.mydomain.com , and if other user create he's result is too = ts.mydomain.com

can i reduce the slot's, the person can create up to 100 slots
In File: Index.php
Replace in line 13
from this:
PHP:
$slots = $_POST['slots'];
to this:
PHP:
$slots = 100;
and line 125
from this:
PHP:
<input name="slots" required="required" type="text" placeholder="100" />
to this:
PHP:
<input name="slots" readonly type="text" value="100"/>
THIS IS SPECIFIC FOR 100 SLOTS
 

Top