0
<?php
	$MD5Code = "kikugalanet"; // Your Neuz MD5 Code
	$dbAddr = "127.0.0.1"; // Your MSSQL Host IP
	$dbName = "ACCOUNT_DBF"; // Your Account Database
	$dbUser = "sa"; // Your Database user
	$dbPass = ""; // Your Database User password

	if(!extension_loaded("mssql")) {
		echo "The MSSQL extension is not enabled on your PHP. Enable it on your php.ini and try again.";
		exit();
	}
?>
<!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>Fly For Fun :: Official Files Simple 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 servers!";
				}
				@mssql_free_statement($addNewUsr);
				@mssql_close($dbLink);
			}
			
		}
	?>
	<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
		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>

im using mssql for the database how can i run it?

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

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by qhuemone
0

Whats the problem you are facing?

i can't see the output of it because my wamp server is not supporting the mssql.dll files but in the other forums they said that the output of this is you have missing fields only..

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.