Register bug fix
This commit is contained in:
parent
26ecb2596f
commit
aa377addeb
@ -6,21 +6,23 @@
|
||||
$pswd = ($_POST['registerPassword']);
|
||||
$email = ($_POST['registerMail']);
|
||||
|
||||
$search_user = $database->prepare("SELECT ID FROM user WHERE username='$name '");
|
||||
$search_user->execute();
|
||||
$search_result = $search_user->get_result();
|
||||
if ($name != " " && $pswd != " " && $email != " ") {
|
||||
$search_user = $database->prepare("SELECT ID FROM user WHERE username='$name '");
|
||||
$search_user->execute();
|
||||
$search_result = $search_user->get_result();
|
||||
|
||||
if ($search_result->num_rows == 0) {
|
||||
$pswd = md5($pswd);
|
||||
$stmt = $database->prepare("INSERT INTO user(username, email, password) VALUES (?,?,?)");
|
||||
$stmt->bind_param("sss", $name, $email, $pswd);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
echo json_encode("Dein Account wurde erfolgreich erstellt!");
|
||||
if ($search_result->num_rows == 0) {
|
||||
$pswd = md5($pswd);
|
||||
$stmt = $database->prepare("INSERT INTO user(username, email, password) VALUES (?,?,?)");
|
||||
$stmt->bind_param("sss", $name, $email, $pswd);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
echo json_encode("Dein Account wurde erfolgreich erstellt!");
|
||||
} else {
|
||||
echo json_encode("Der Benutzername ist leider schon vergeben!");
|
||||
}
|
||||
} else {
|
||||
echo json_encode("Der Benutzername ist leider schon vergeben!");
|
||||
echo json_encode("Erstes Zeichen darf kein Leerzeichen sein!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user