<h1>Athens Fiesta</h1>
<p>
We are looking forward to make Athens Fiesta Online better, and we need your support.<br />
By donating you can help us provide best gaming experience to every player including you.<br />
Goal: New Dedicated server. (Dual CPU, 24GB Ram, Rid 0 40GB SSD)<br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="6NQTQPHL46H64">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

</p>
<br /><br />
<?php
// Registration Script by DanSpd
// me@danspd.com
ini_set( "display_errors", 0);

function mssql_escape_string($string_to_escape) { $replaced_string = str_replace("'","''",$string_to_escape); return $replaced_string; } 

if ( $_POST['Register'] )
{
	$username	= mssql_escape_string( $_POST['username'] );
	$password	= mssql_escape_string( $_POST['password'] );
	$password2	= mssql_escape_string( $_POST['password2'] );
	
	if ( strlen( $username ) > 15 || strlen( $username ) < 3 ) $errors[] = 'Username must be at least 3 characters long and no longer that 15 characters';
	if ( ereg( '[^A-Za-z0-9]' , $username) ) $errors[] = 'Username must be alphanumeric!';
	if ( strlen( $password ) > 15 || strlen( $password ) < 3 ) $errors[] = 'Password must be at least 3 characters long and no longer that 15 characters';
	if ( $password != $password2 ) $errors[] = 'Passwords do not match';
	
	if ( count( $errors ) == 0 )
	{
		$mssql_link = mssql_connect( 'VADIM-5286\\SQLEXPRESS', 'sa', 'yAsejaZat+u9eNuP' );
		if ( !$mssql_link )
		{
			die( 'Can\'t connect to database!' );
		}
		else
		{
			$checkUser = mssql_query( "SELECT * FROM Account..tUser WHERE sUserID = '$username';" );
			if ( mssql_num_rows( $checkUser ) == 0 )
			{
				$inserUser = mssql_query( "INSERT INTO Account..tUser (sUserID, sUserPW, sUserName) VALUES ('$username', '$password', '$username');" );
				if( $inserUser )
				{
					echo 'Account has been created! Enjoy!';
				}
				else
				{
					die( 'MSSQL Error!' );
				}
			}
			else
			{
				die( 'Such username is already in use!' );
			}
		}
	}
	else
	{
		foreach ( $errors as $myError )
		{
			echo '<br />'.$myError;
		}
	}
}
else
{ ?>
<form method="post">
	<table width="400px">
		<tr>
			<td>Username</td>
			<td><input type="text" name="username" /></td>
		</tr>
		<tr>
			<td>Password</td>
			<td><input type="password" name="password" /></td>
		</tr>
		<tr>
			<td>Password confirmation</td>
			<td><input type="password" name="password2" /></td>
		</tr>
		<tr>
			<td></td>
			<td><input type="submit" name="Register" value="Create Account" /></td>
		</tr>
	</table>
</form>
<?php } ?>