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