This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [Website] Creating an Account Creation Webpage  (Read 1517 times)

Valkryst

  • Moderators
  • Model Change Addict
  • *****
  • Posts: 224
    • View Profile
    • http://valkryst.com/blog/
[Website] Creating an Account Creation Webpage
« on: June 04, 2014, 06:50:51 pm »
I apologize for any strange formatting. I'll be going through all of my tutorials posted here and fixing any major issues after posting all of the tutorials.
This tutorial looks to be fairly messed-up at the moment so I'll get to it first when I'm done.

Hey,

Just as the rest of my tutorials have begun, I spent many hours trying to figure this out for myself and, in the end, it took a combination of my friend's and my knowledge to get this working properly. I cannot fully support any questions regarding php as I only know enough to get by, but I can answer most questions regarding HTML and CSS. If anyone notices an error in this guide or even some piece of code that can be optimized/changed, just comment and I'll do my best to keep this thread updated. Special thanks to InternetExplorer and stoneharry for their help in pointing out vulnerabilities and helping to fix them.

Just in case anyone wants to know what I'm running:
Windows 8, x64 -- Home
Debian 7 x32 -- Server
TrinityCore -- Latest version as of 13/Apr/2014
WoTLK 3.3.5a

As this guide is quite a bit more advanced than the simple DBC editing guides I've written before, I'm going to assume that anyone reading this has at least a basic knowledge of HTML, CSS, have a web server up and running with php, are running MySQL for your servers database, and have a webpage already ready for the code I'm going to supply you with. I will not be going too in-depth with this guide as it only requires a few simple (not if you had to figure it out from scratch) steps.

I'll apologize in advance for any weird code indentation. When I copy-paste the code from my editor into this it gets a bit messy, but it's still fairly neat.

-----------------------------------------------------------------------------------------------------------------------------------

The first thing you should do is open up the .PHP file of the webpage where you want your account creation form to be. Now go to the section of the code where you wish to have the account creation form. Now copy and paste the code below into that section.
http://pastebin.com/SNqBaTbG

At the top of your HTML document, please include this short statement.


Now open up the style.css file of your page and add in the code below at the very end, or wherever you want if you like to keep your .CSS files organized like me.
http://pastebin.com/yCYqKHZc


The next step is very important. Create a file named config.inc.php and paste the following code within it. Make sure to edit all of the lines properly or else the php code for the account creation form will not be able to connect to your database. I'm assuming that you know enough to be able to fill out this information, if you're having trouble just post in the comments.
http://pastebin.com/37CrguPV

You can now upload style.css, config.inc.php, and the webpage .PHP file back onto your server. The last step is to log into your database using a program such as HeidiSQL and execute the query below onto the auth database.
http://pastebin.com/BqdiLrkz

The account page should now be up and running. ;)


Link to the fullsized image. The typo in the first error message has been corrected.


Link to the fullsized image.

-----------------------------------------------------------------------------------------------------------------------------------

Thanks for reading! If you have any suggestions on how to improve this tutorial, just comment.

If you want to stay up-to-date with my latest tutorials or if you just want an easier way to view all of my tutorials and releases in one place then take a look at my blog.

-----------------------------------------------------------------------------------------------------------------------------------

Edited:

Updated the register() function in the HTML file to better increase security against SQL injection. Credits to stoneharry for the suggestion to do so.

20/May/2014 - Modified the entire config.inc.php and large portions of the php code in the HTML file to close up some security vulnerabilities.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
MY BLOG IS NOW HERE.