Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. if (isset($_POST['login'])) { $Link = MySQL_Connect($DB_Host, $DB_User, $DB_Password) or die ("Can't connect to MySQL"); MySQL_Select_Db($DB_Name, $Link) or die ("Database ".$DB_Name." does not exist."); $Login = $_POST['login']; $Pass = $_POST['passwd']; $Repass = $_POST['repasswd']; $Email = $_POST['email']; $Login = StrToLower(Trim($Login)); $Pass = Trim($Pass); $Repass = Trim($Repass); $Email = StrToLower(Trim($Email)); if (empty($Login) || empty($Pass) || empty($Repass) || empty($Email)) { echo "One or more fields are empty."; } /* elseif (ereg("[^0-9a-zA-Z_-]", $Login, $Txt)) { echo "Incorrect User Name format."; } elseif (ereg("[^0-9a-zA-Z_-]", $Pass, $Txt)) { echo "Incorrect Password format."; } elseif (ereg("[^0-9a-zA-Z_-]", $Repass, $Txt)) { echo "Confirmation password error."; } */ elseif (StrPos('\'', $Email)) { echo "Incorrect Email Address format."; } else { $Result = MySQL_Query("SELECT name FROM users WHERE name='$Login'") or ("Can't execute query."); if (MySQL_Num_Rows($Result)) { echo "Account ".$Login." already exists"; } elseif ((StrLen($Login) < 4) or (StrLen($Login) > 10)) { echo "User Name must have more than 4 and not more than 10 characters."; } elseif ((StrLen($Pass) < 4) or (StrLen($Pass) > 10)) { echo "Password must have more than 4 and not more than 10 characters."; } elseif ((StrLen($Repass) < 4) or (StrLen($Repass) > 10)) { echo "Confirmation password error."; } elseif ((StrLen($Email) < 4) or (StrLen($Email) > 25)) { echo "Email Address must have more than 4 and not more than 25 characters."; } elseif ($Pass != $Repass) { echo "Confirmation password error."; } else { $Salt = $Login.$Pass; $Salt = md5($Salt); $Salt = "0x".$Salt; MySQL_Query("call adduser('$Login', $Salt, '0', '0', '0', '0', '$Email', '0', '0', '0', '0', '0', '0', '0', '', '', $Salt)") or die ("Can't execute query."); $mysqlresult=MySQL_Query("select * from `users` WHERE `name`='$Login'"); $User_ID=MySQL_result($mysqlresult,0,'ID'); MySQL_Query("call usecash('$User_ID',1,0,1,0,100000,1,@error)") or die ("usecash failed!"); echo "Account ".$Login." has been registered."; // echo "Conta ".$Login." foi bem registrada."; } } } echo $Data; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement