Advertisement
Guest User

Untitled

a guest
May 31st, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. <?php
  2. $serverName = "127.0.0.1"; //serverName\instanceName
  3. $connectionInfo = array( "Database"=>"dnmembership", "UID"=>"DragonNest", "PWD"=>"FD9D60B133f498b");
  4. $conn = sqlsrv_connect( $serverName, $connectionInfo);
  5.  
  6. if($conn) {
  7.  
  8. //do nothing here.
  9.  
  10. }else{
  11. echo "Connection could not be established.<br />";
  12. die( print_r( sqlsrv_errors(), true));
  13. }
  14.  
  15. if($_POST['submit']) // checks to see if the player has pressed submit to get to this page.
  16. {
  17. //gather the submitted details and clean it using stripslashes
  18. $Username = stripslashes($_POST['username']);
  19. $Password = stripslashes($_POST['password']);
  20. $PasswordConfirm = stripslashes($_POST['confirmpassword']);
  21.  
  22. //FOR EXTRA SECURITY
  23. mysql_real_escape_string($Username);
  24. mysql_real_escape_string($Password);
  25. mysql_real_escape_string($PasswordConfirm);
  26.  
  27. if($PasswordConfirm !=$Password){ echo("The passwords do not match.");}
  28. if((!$Password) || (!$PasswordConfirm)){ echo("Please re enter your information.");}
  29.  
  30. else{
  31. sqlsrv_query($conn, "INSERT INTO dnmembership.dbo.Accounts (AccountName, AccountLevelCode, GameOption, CharacterCreateLimit, LastCharacterCreateDate, CharacterMaxCount, LastLoginDate, LastLogoutDate, LastLoginIP, LastSessionID, JoinIP, RegisterDate, PublisherCode, GenderCode, BirthDate, Passphrase, NationalityCode, ChannelPartnerCode,NxLoginPwd)
  32. VALUES ('$Username', '0', NULL, '7', NULL, '4', NULL, NULL, NULL, NULL, NULL, GETDATE(), '4', NULL, NULL, NULL, NULL, NULL, (SELECT substring(sys.fn_VarBinToHexStr(hashbytes('MD5','$Password')),3,32))) DECLARE @return_value int
  33. EXEC @return_value = [dbo].[P_ModCashBalance]
  34. @nvcAccountName = N'$Username', @IntCashBalance = 0
  35. SELECT 'Return Value' = @return_value") or die("That account already exists, try a different username.");
  36.  
  37. echo("Your account has been created, have fun at BlackDN.");
  38. }
  39. }
  40. else
  41. {
  42. echo("Access to this page has been denied.");
  43. }
  44.  
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement