I’ve been working on some side projects to fill out my portfolio, and one of these projects is an account creation website for TrinityCore. I wrote this so that anyone can take this website and use it for their own server. This website is responsive, so it will work on mobile- and tablet-sized browsers.
Here is a live example: http://www.adamelders.com/trinity/account/
I have an ‘auth’ database set up on my server for testing purposes, it doesn’t get used anywhere else, or by anything else. Still, you should not enter your own private information into the live example site.
Here is the source code: https://github.com/adamelders/trinity-projects/tree/master/Trinity Account Creator
NOTE: You will need a web server that supports at least PHP version 7.1 or higher. I have not tested with any versions below that. Your web server will also need to support the PDO extension, with the pdo_mysql driver. These options should be available with most modern hosting services, but if you encounter any issues, this should be the first thing for you to check.
[SIZE=18px]How to install/set up:[/SIZE]
First, download and extract the files: http://www.adamelders/com/trinity/Trinity Account Creator.rar
You will then need to configure the website for your own server. Open up the db.php file inside the db folder. There is a section at the top you can edit to your database information:
[CODE]
/* --------------------- ONLY EDIT THE VALUES BELOW THIS LINE --------------------- */
private $host = "localhost"; // IP or hostname of your server.
private $username = "username"; // Database username.
private $password = "password"; // Database password.
private $dbname = "auth"; // Database name (i.e. "auth").
/* --------------------- DO NOT EDIT ANYTHING BELOW THIS LINE --------------------- */
[/CODE]
After you edit the above information, you will need to upload the files to your web server, doesn’t matter where. Then you should be done!
[SIZE=18px]Additional Options:[/SIZE]
There are a couple of additional options you can use to customize this website.
- I have uploaded 5 backgrounds for use with the site, you can change the backgrounds in /css/style.css:
/* Change this to the desired background image */
background-image: url('../img/bg-1.png');
/* ------------------------------------------- */
The five background images are named “bg-1.png”, “bg-2.png”, “bg-3.png”, bg-4.png", and “bg-5.png”. Edit the above line in style.css to your desired background image.
- You can upload your own logo to appear at the top of the page instead of the TrinityCore logo. To do this, upload your logo image to the /img/ folder. Then, edit the following line in index.html (line 23):
<img src="img/tc_logo.png" class="img-fluid rounded mx-auto d-block" alt="Logo">
Edit the “src” attribute to match the name of your logo image file, i.e. “img/my_logo.jpg”.
[SIZE=18px]Technical stuff:[/SIZE]
This website uses jQuery to stop the form submission (so it will still use HTML5/Bootstrap input validation), then runs a JavaScript function that uses an AJAX call to a PHP script. A status message is shown with the results from the AJAX call.
If you find any issues with this website, or have any questions, just let me know. I will try to answer them as soon as possible.
Lastly, feel free to modify the site to your liking. I only ask that you provide some credit on your website (i.e. leave the footer as-is, just add your own info to it).