no offense, but ANOTHER useless post.
This is a discussion on Registration Script for website (Website Add-on) within the Releases forums, part of the Alternative Languages category; I decided to release this script, I used to use it on my Maple Story server's website before. You can ...
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.
Download here!
Config2.php
PHP Code:<?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 by TheForce; 30-04-10 at 05:39 PM.
no offense, but ANOTHER useless post.
Let's have a toast for the douchebags, Let's have a toast for the assholes, Let's have a toast for the scumbags,
Every one of them that I know Let's have a toast to the jerkoffs That'll never take work off Baby, I got a plan Run away fast as you can
You forgot to include "config2.php"
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 by TheForce; 30-04-10 at 05:40 PM. Reason: Added to the main post, config2.php
But....what kind of site doesn't have registration to start with???
Search before posting.
more complex for most of you:
register.php
some other file LOLPHP Code:<?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";
}
}
}
?>
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 lolPHP Code: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!";
}
}
Umm, how about INSERT INTO `accounts` (name, password, pin) VALUES ($username, $passwordaftersha1, $pin);
How many times has this actually been released though?
[SIGPIC][/SIGPIC]
eat some spectrum