0
<?php
	 $MD5Code = "kikugalanet"; // Your Neuz MD5 Code
	 $dbAddr = "127.0.0.1"; // Your MSSQL Host IP
	 $dbName = "ACCOUNTS_DBF"; // Your Account Database
	 $dbUser = "root"; // Your Database user
	 $dbPass = ""; // Your Database User password
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
<title>AminusFlyff :: Register Page</title>
</head>
<body>
	<?php
		function cleanFormData($data) {
			$data = @strtolower($data);
			$data = @trim($data);
			$data = @htmlentities($data);
			$data = @strip_tags($data);
			return $data;
		}
		if(isset($_POST['regacc'])) {
			// Form Data
			$usrLogin = cleanFormData($_POST['user']); // Username
			$usrPassNoMD5 = cleanFormData($_POST['pass']); // Password non-encrypted
			
			if($usrLogin = "" || empty($usrLogin) || $usrPassNoMD5 = "" || empty($usrPassNoMD5)) {
				echo "You left blank fields!";
				exit();
			}
			$dbLink = @mssql_connect($dbAddr, $dbUser, $dbPass);
			if(!$dbLink) {
				echo "Failed on processing your register form.<br />Reason: Cannot connect to SQL Server<br />Try to refresh the page or try again later.<br />We 

apologize for any inconvenience.";
				@mssql_close($dbLink);			
				exit();
			}
			@mssql_select_db($dbName, $dbLink);
			$checkUsrQ = @mssql_query("SELECT account FROM ACCOUNT_TBL WHERE account='".$usrLogin."'");
			$checkUsr = @mssql_num_rows($checkUsrQ);
			if($checkUsr > 0) {
				echo "This username is already been used by another player.";
				@mssql_free_result($checkUsrQ);
				@mssql_close($dbLink);
				exit();
			} else {
				@mssql_free_result($checkUsrQ);
				@mssql_close($dbLink);
				$usrPass = md5($MD5Code . $usrPassNoMD5);
				$storedProc = @mssql_init("createaccount", $dbLink);
				$usrAccParameter = @mssql_bind($storedProc, '@account', $usrLogin, SQLVARCHAR, false, false, 15);
				$usrPwdParameter = @mssql_bind($storedProc, '@password', $usrPass, SQLVARCHAR, false, false, 32);
				$addNewUsr = @mssql_execute($storedProc);
 				if(!$addNewUsr) {
					echo "Failed on processing your register form.<br />Try to refresh the page or try again later.<br />We apologize for any 

inconvenience.";
				} else {
					echo "Your account has been created sucessfully!<br />Your login: <b>".$usrLogin."</b> - Your Pass: ****<br />Enjoy playing on our 

server!";
				}
				@mssql_free_statement($addNewUsr);
				@mssql_close($dbLink);
			}
			
		}
	?>
	[U][B]<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">[/B][/U]
		Username: <input type="text" name="user" size="15" maxlenght="15" /><br />
		Password: <input type="password" name="pass" size="15" /><br />
		Name: <input type
		<input type="submit" name="regacc" />
	</form>
</body>
</html>

does the underlined code right? Coz' im getting a white screen output when i press submit query button im using the xampp server

Edited by __avd: Added [code] tags. Encase your code in: [code] and [/code] tags.

2
Contributors
1
Reply
3
Views
7 Years
Discussion Span
Last Post by network18
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.