Hi all,
I've made a simple register page for the official server files:
How to use:PHP Code:<?php
ini_set('display_errors', 0);
$connection = mssql_connect('YOURHOST', 'sa', 'YOURPASSWORD'); //Change YOURHOST and YOURPASSWORD
if(!connection || !mssql_select_db('ACCOUNT_DBF', $connection))
{
die('Unable to connect or select database!');
}
$checkusername = $_POST['Username'];
$query = mssql_query("SELECT account FROM ACCOUNT_TBL WHERE account = '$checkusername'");
$result = mssql_fetch_row($query);
if(isset($_POST['submit'])){
if($_POST['Username'] == ""){
$error = '<font color="red">Please enter a username.</font>';
}
else if($result[0] == $checkusername){
$error = '<font color="red">This username already exists. Please choose another one.</font>';
}
else if($_POST['Password'] == ""){
$error = '<font color="red">Please enter a password.</font>';
}
else if($_POST['Password2'] == ""){
$error = '<font color="red">You did not repeat your password.</font>';
}
else if($_POST['Password'] != $_POST['Password2']){
$error = '<font color="red">Passwords do not match.</font>';
}
else if($_POST['birthday'] == ""){
$error = '<font color="red">Please enter your birthday.</font>';
}
else if($_POST['mail'] == ""){
$error = '<font color="red">Please enter your e-mail adress.</font>';
}
else{
$password = md5('nForceIsGay' . $_POST['Password']);
$stmt = mssql_init('webCreateAcc', $connection);
mssql_bind($stmt, '@account', $checkusername, SQLVARCHAR, false, false, 15);
mssql_bind($stmt, '@password', $password, SQLVARCHAR, false, false, 36);
mssql_bind($stmt, '@birthday', $_POST['birthday'], SQLVARCHAR, false, false, 120);
mssql_bind($stmt, '@email', $_POST['mail'], SQLVARCHAR, false, false, 120);
mssql_execute($stmt) or die ("Could not complete the registration. Please try again.");
mssql_free_statement($stmt);
$error = '<font color="green">Registration complete!</font>';
}
}
echo '<form action="register.php" method="post">';
echo 'Username: <input type="text" name="Username" /><br /><br />';
echo 'Password: <input type="password" name="Password" /><br /><br />';
echo 'Repeat password: <input type="password" name="Password2" /><br /><br />';
echo 'Birthday: <input type="text" name="birthday" /><br /><br />';
echo 'E-mail: <input type="text" name="mail" /><br />';
echo '<input type="submit" name="submit" value="Register" />';
echo '</form>';
echo $error;
?>
#1: Change the host and the password at the beginning of this code.
#2: Save this code as register.php.
#3: Enjoy!
Credits:
Credits go to me and zyberscape (For using a small piece of his code).

