Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. Please fill in all the configuration settings! For your own security and the functionality of the script, you cannot leave them blank."); } ##Connect## $mssql_connect = mssql_connect($mssql_server, $mssql_username, $mssql_password) or die ("Cannot connect to the MSSQL Database."); $mssql_select = mssql_select_db($mssql_account_db) or die ("Cannot select the MSSQL Database."); ##Function## function doesUsernameExist($username){ $exit = FALSE; $result = @mssql_query("SELECT * FROM $mssql_account_table WHERE $mssql_username_column='$username'"); if (mssql_num_rows($result) != 0){ $exit = TRUE; } return $exit; } $pusername = $_POST['username']; //Post wsername $ppassword = $_POST['password']; //Post password $prpassword = $_POST['rpassword']; //Post re-enter password $fpassword = md5($hash . $password); //Full/Final password $random_text = $_POST['random_text']; //Random text if (isset($_POST['submit']) == true) { $username = preg_replace("/[^a-zA-Z0-9\-\_\!\$\#\@\^\&\*\(\)\^\+\ \.\?]/", "", $pusername); $password = preg_replace("/[^a-zA-Z0-9\-\_\!\$\#\@\^\&\*\(\)\^\+\ \.\?]/", "", $ppassword); if ((isset($_POST['submit']) == true) and (strlen($pusername) < 3) || (strlen($pusername) > 15)) { echo "Your username must be between 3 and 15 characters in length."; } else if ((isset($_POST['submit']) == true) and ((strlen($ppassword) < 3) || (strlen($ppassword) > 15) || (strlen($prpassword) < 3) || (strlen($prpassword) > 15))) { echo "The password must be between 3 and 15 characters in length."; } else if ((isset($_POST['submit']) == true) and ($ppassword != $prpassword)) { echo "The passwords must be the same."; } else if ((isset($_POST['submit']) == true) and (($pusername == $ppassword) || ($pusername == $prpassword))) { echo "The username and password cannot be the same."; } else if ((isset($_POST['submit']) == true) and ($random_text != $random_text_text)) { echo "The random text must be filled in correctly. Please take another look at the random text."; } else { if ((isset($_POST['submit']) == true) and (!doesUsernameExist($username))) { $stmt = mssql_init('createaccount', $mssql_connect); mssql_bind($stmt, '@account', $username, SQLVARCHAR, false, false, 15); mssql_bind($stmt, '@password', $fpassword, SQLVARCHAR, false, false, 36); mssql_execute($stmt) or die ("Error occurred while executing the statement."); mssql_free_statement($stmt); echo "You've been successfully registered as " . $username . "!"; } else { echo "The username already exists."; } } } ?>
  2. Username
  3.  
  4. Password
  5.  
  6. Re-enter Password
  7.  
  8. Please enter "" without the brackets below
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement