Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Registration Script for website (Website Add-on)

Status
Not open for further replies.
Newbie Spellweaver
Joined
Nov 16, 2008
Messages
11
Reaction score
0
I decided to release this script, I used to use it on my Maple Story server's website before. You can edit it, integrate it into your website or whatever. This is for the people who are wanting to create there own website instead of using a CMS. This script has been tested and works 100% for a Maple Story server. It should work for anything.




Config2.php
PHP:
<?php
$host['naam'] = 'localhost';                // my host
$host['gebruikersnaam'] = 'root';       // my database username
$host['wachtwoord'] = '';   // my database password
$host['databasenaam'] = 'odinms';       // my database name

$db = mysql_connect($host['naam'], $host['gebruikersnaam'], $host['wachtwoord']) OR die ('Cant connect to the database');
mysql_select_db($host['databasenaam'], $db);

$serverip = "127.0.0.1";     //Replace with your WAN IP if public
$loginport = "8484";	     //Don't change
$sql_db = "odinms";		     //DB Name
$sql_host = "localhost";     //DB Host
$sql_user = "root";	     	 //DB User
$sql_pass = "";		     	 //DB Password
$logserv_name = "<b>Server</b>: ";		 //Status Server Name
$offline = "<s>Offline</s>";  //Displays Offline Status
$online = "<u>Online</u>";	//Displays Online Status
?>
 
Last edited:
Newbie Spellweaver
Joined
Nov 16, 2008
Messages
11
Reaction score
0
I'll add the config2.php later on this thread. I thought you could make your own, connecting your database.

Added Config.php script.
 
Last edited:
Junior Spellweaver
Joined
Jan 7, 2009
Messages
105
Reaction score
2
But....what kind of site doesn't have registration to start with???
 
Infraction Baɴɴed
Loyal Member
Joined
Apr 9, 2008
Messages
1,416
Reaction score
169
more complex for most of you:

register.php
PHP:
<?php
if($_SESSION[id]){
		echo "<fieldset><legend><b>Error!</b></legend>";
		echo "You are already logged in, therefore you can not register a new account!";
		echo "</fieldset>";
}else{
	if(!$_POST[register]){
		echo "<fieldset><legend><b>Registration</b></legend><br />";
		echo "Fill out all of these fields below in order to create a new account. This account will be used to enter <b>".$server_name."</b>, so you are advised not to share the informations with anyone at all!<br /><br />";
		echo "<form method=\"POST\">";
		echo "<center><table border=\"0\" width=\"300\">";
		echo "<tr><td align=\"right\" width=\"50%\"><b>Username</b></td><td><input class=\"login\" type=\"text\" name=\"username\" maxlength=\"12\"></td></tr>";
		echo "<tr><td align=\"right\" width=\"50%\"><b>Password</b></td><td><input class=\"login\" type=\"password\" name=\"password\" maxlength=\"12\"></td></tr>";
		echo "<tr><td align=\"right\" width=\"50%\"><b>Confirm Password</b></td><td><input type=\"password\" class=\"login\" name=\"cpassword\" maxlength=\"12\"></td></tr>";
		echo "<tr><td align=\"right\" width=\"50%\"><b>E-mail</b></td><td><input class=\"login\" type=\"text\" name=\"email\"></td></tr>";
		echo "<tr><td align=\"right\" width=\"50%\"><b>Birthday</b><br /><i>(YYYY-MM-DD)</i></td><td valign=\"top\"><input class=\"login\" type=\"text\" maxlength=\"10\" name=\"birth\"></td></tr>";
		echo "<tr><td></td><td><input type=\"submit\" value=\"Register\" name=\"register\">";
		echo "</table></center></form>";
		echo "</fieldset>";
	} else {
		if(!(empty($_POST[username])||empty($_POST[password])||empty($_POST[cpassword])||empty($_POST[email])||empty($_POST[birth]))) {
			$Main->useClass('Database')->register(implode("_",$_POST));
		} else {
			echo "Doesnt";
		}
	}
}
?>
some other file LOL
PHP:
public function register($explode) {
		$array = explode("_", MySQLi_Real_Escape_String($this->MySQLi,$explode));
		if(strlen($array[0]) < 4 || strlen($array[0]) > 12) {
			die("Username must be between 4 and 12 characters!");
		} elseif(MySQLi_Num_Rows($this->query("SELECT `name` FROM `accounts` WHERE `name` = '{$array[0]}'")) >= 1) {
			echo "The username already exists. Please select another one!";
		} elseif(strlen($array[1]) < 6 || strlen($array[1]) > 12) {
			echo "Password must be between 6 and 12 characters!";
		} elseif($array[1] != $array[2]) {
			echo "The passwords don't match!";
		} else {
			#$Insert = $this->query("INSERT INTO `accounts` (`name`,`password`,`birthday`,`email`) VALUES ('{$array[0]}','".sha1($array[1])."','{$array[4]}','{$array[3]}')") or die(mysql_error());
			echo "The user has been succesfully added into the database! You can now log into the community and in-game!";
		}
	}

dont really care for it because half of you wont know what to do or how it works. plus the form part was just copied over lol
 
Custom Title Activated
Loyal Member
Joined
Nov 27, 2009
Messages
1,905
Reaction score
948
Umm, how about INSERT INTO `accounts` (name, password, pin) VALUES ($username, $passwordaftersha1, $pin);

How many times has this actually been released though?
 
Infraction Baɴɴed
Loyal Member
Joined
Apr 9, 2008
Messages
1,416
Reaction score
169
Umm, how about INSERT INTO `accounts` (name, password, pin) VALUES ($username, $passwordaftersha1, $pin);

How many times has this actually been released though?
totally works when you use it on a website
 
Junior Spellweaver
Joined
Jul 12, 2008
Messages
130
Reaction score
6
Wow, fuckin leeched & everyone definitely already has this -.- OP Fails hard!
 
Junior Spellweaver
Joined
Mar 25, 2009
Messages
162
Reaction score
6
Don't you love how supporting we are here at Ragezone?! =D
 
Status
Not open for further replies.
Back
Top