Skip to content

Commit

Permalink
Update register.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron-Junker authored Jan 3, 2022
1 parent 06217c6 commit 21e8bfd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions login/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
if(preg_match('/^[a-z0-9A-Z.:,;]{8,25}$/',$_POST["P"])){
$register = True;
$sql = "SELECT * FROM User";
$db_erg = mysqli_query($U->db_link, $sql);
while ($row = mysqli_fetch_array($db_erg, MYSQLI_ASSOC))
$dbRes = mysqli_query($U->db_link, $sql);
while ($row = mysqli_fetch_array($dbRes, MYSQLI_ASSOC))
{
//Checks if username or mail are in use
if(strtolower($row["Username"]) == strtolower($_POST["U"])||strtolower($row["Mail"])==strtolower($_POST["M"])){
Expand Down Expand Up @@ -57,8 +57,8 @@
if($register){
//Register succeeded:
//Register user
$sql = 'INSERT INTO User (Username, Mail, Password, Type) VALUES ('."'".$_POST["U"]."'".','."'".$_POST["M"]."'".','."'".password_hash($_POST["P"],PASSWORD_DEFAULT)."'".',0);';
if($db_erg = mysqli_query($U->db_link, $sql)){
$sql = 'INSERT INTO User (Username, Mail, Password, Type) VALUES ('."'".mysqli::real_escape_string($_POST["U"])."'".','."'".mysqli::real_escape_string($_POST["M"])."'".','."'".password_hash(mysqli::real_escape_string($_POST["P"]),PASSWORD_DEFAULT)."'".','.$USOC["userRights"]["AfterRegistration"].');';
if($dbRes = mysqli_query($U->db_link, $sql)){
//Database register is succeeded
echo $U->getLang("register.succeed");
header("Location: ".$USOC["DOMAIN"]);
Expand Down

0 comments on commit 21e8bfd

Please sign in to comment.