PHP-Code:
<?php
$t = true;
if(isset($_POST['step1'])) {
$t = false;
unset($_POST['step1']);
var_dump($_POST);
echo "eofo";
if($_POST['vcode'] != "") {
echo "ppp";
$vcode = htmlspecialchars(trim($_POST['vcode']));
$checkvcode_statement = $pdo->prepare("SELECT * FROM verificodes WHERE code like :code");
$checkvcode_statement->bindParam("code", $vcode);
$checkvcode_statement->execute();
$checkvcode_result = $checkvcode_statement->fetch();
if($checkvcode_result['id'] != null) {
if($checkvcode_result['used'] != "true" && $checkvcode_result['used'] == "false") {
$username = $checkvcode_result['name'];
?>
<form class="col-md-6 offset-md-3" action="?p=register" method="post">
<div class="form-group">
<label>Benutzername</label>
<input type="text" name="username" class="form-control disabled" value="<?php echo $username; ?>" disabled>
<p style="font-size: 12px; Color: red;">Hinweis: Dein Benutzername ist der Name des Verknüpften MineCraft-Accounts. Diesen Namen kannst du <b>NICHT</b> mehr ändern!</p>
</div>
<div class="form-group">
<label>Passwort</label>
<input type="password" name="password" class="form-control" required>
</div>
<div class="form-group">
<label>Passwort wiederholen</label>
<input type="password" name="password_repeat" class="form-control" required>
</div>
<div class="form-group">
<input type="submit" name"step2" class="btn btn-outline-primary" value="Registrieren">
</div>
</form>
<?php
unset($_POST);
} else { ?>
<div class="alert alert-danger" role="alert"><button type="button" class="close" data-dismiss="alert">×</button><p class="text-center">Der eingegebene Code wurde bereits verwendet!</p></div>
<form class="col-md-6 offset-md-3" action="?p=register" method="post">
<div class="form-group">
<label>Verifizierungscode:</label>
<input type="text" name="vcode" class="form-control" required>
<a href="?p=faq&c=vcode" style="Font-Size: 12px; Color: green;">Klicke hier um zuerfahren wie du einen Code bekommst.</a>
</div>
<div class="form-group">
<input type="submit" name="step1" class="btn btn-outline-primary" value="weiter">
</div>
</form>
<?php
unset($_POST);
}
unset($_POST);
} else { ?>
<div class="alert alert-danger" role="alert"><button type="button" class="close" data-dismiss="alert">×</button><p class="text-center">Der Eingegebene Code existiert nicht!</p></div>
<form class="col-md-6 offset-md-3" action="?p=register" method="post">
<div class="form-group">
<label>Verifizierungscode:</label>
<input type="text" name="vcode" class="form-control" required>
<a href="?p=faq&c=vcode" style="Font-Size: 12px; Color: green;">Klicke hier um zuerfahren wie du einen Code bekommst.</a>
</div>
<div class="form-group">
<input type="submit" name="step1" class="btn btn-outline-primary" value="weiter">
</div>
</form>
<?php
unset($_POST);
}
} else { echo "21111";?>
<div class="alert alert-danger" role="alert"><button type="button" class="close" data-dismiss="alert">×</button><p class="text-center">Bitte gebe einen Verifizierungscode in das Feld ein!</p></div>
<form class="col-md-6 offset-md-3" action="?p=register" method="post">
<div class="form-group">
<label>Verifizierungscode:</label>
<input type="text" name="vcode" class="form-control" required>
<a href="?p=faq&c=vcode" style="Font-Size: 12px; Color: green;">Klicke hier um zuerfahren wie du einen Code bekommst.</a>
</div>
<div class="form-group">
<input type="submit" name="step1" class="btn btn-outline-primary" value="weiter">
</div>
</form>
<?php
}
}elseif(isset($_POST['step2'])) {
echo "RRDGraph";
if($_POST['password'] == "" && $_POST['password_repeat'] == "") { ?>
<form class="col-md-6 offset-md-3" action="?p=register" method="post">
<div class="form-group">
<label>Benutzername</label>
<input type="text" name="username" class="form-control disabled" value="<?php echo $username; ?>" disabled>
<p style="font-size: 12px; Color: red;">Hinweis: Dein Benutzername ist der Name des Verknüpften MineCraft-Accounts. Diesen Namen kannst du <b>NICHT</b> mehr ändern!</p>
</div>
<div class="form-group">
<label>Passwort</label>
<input type="password" name="password" class="form-control is-invalid" required>
<div class="invalid-feedback">
Bitte gebe ein Passwort ein!
</div>
</div>
<div class="form-group">
<label>Passwort wiederholen</label>
<input type="password" name="password_repeat" class="form-control is-invalid" required>
<div class="invalid-feedback">
Bitte gebe dein Passwort erneut ein!
</div>
</div>
<div class="form-group">
<input type="submit" name"step2" class="btn btn-outline-primary" value="Registrieren">
</div>
</form>
<?php
} elseif($_POST['password'] == "") { ?>
<form class="col-md-6 offset-md-3" action="?p=register" method="post">
<div class="form-group">
<label>Benutzername</label>
<input type="text" name="username" class="form-control disabled" value="<?php echo $username; ?>" disabled>
<p style="font-size: 12px; Color: red;">Hinweis: Dein Benutzername ist der Name des Verknüpften MineCraft-Accounts. Diesen Namen kannst du <b>NICHT</b> mehr ändern!</p>
</div>
<div class="form-group">
<label>Passwort</label>
<input type="password" name="password" class="form-control is-invalid" required>
<div class="invalid-feedback">
Bitte gebe ein Passwort ein!
</div>
</div>
<div class="form-group">
<label>Passwort wiederholen</label>
<input type="password" name="password_repeat" class="form-control is-invalid" required>
<div class="invalid-feedback">
Passwort wiederholung falsch!
</div>
</div>
<div class="form-group">
<input type="submit" name"step2" class="btn btn-outline-primary" value="Registrieren">
</div>
</form>
<?php
} elseif($_POST['password_repeat'] == "") { ?>
<form class="col-md-6 offset-md-3" action="?p=register" method="post">
<div class="form-group">
<label>Benutzername</label>
<input type="text" name="username" class="form-control disabled" value="<?php echo $username; ?>" disabled>
<p style="font-size: 12px; Color: red;">Hinweis: Dein Benutzername ist der Name des Verknüpften MineCraft-Accounts. Diesen Namen kannst du <b>NICHT</b> mehr ändern!</p>
</div>
<div class="form-group">
<label>Passwort</label>
<input type="password" name="password" class="form-control is-valid" required>
</div>
<div class="form-group">
<label>Passwort wiederholen</label>
<input type="password" name="password_repeat" class="form-control is-invalid" required>
<div class="invalid-feedback">
Bitte gebe dein Passwort erneut ein!
</div>
</div>
<div class="form-group">
<input type="submit" name"step2" class="btn btn-outline-primary" value="Registrieren">
</div>
</form>
<?php
} else {
$password = htmlspecialchars(trim($_POST['password']));
$password_repeat = htmlspecialchars(trim($_POST['password_repeat']));
if(strlen($password) < 8) {
if($password == $password_repeat) {
$deactivateCode_Statement = $pdo->prepare("UPDATE verificodes SET used='true' WHERE id = :id");
$deactivateCode_Statement->bindParam("id", $checkvcode_result['id']);
$deactivateCode_Statement->execute();
$pwhash = password_hash($password, PASSWORD_DEFAULT);
$addUser_Statement = $pdo->prepare("INSERT INTO user_users(name, password, uuid, rang) VALUES(:name, :password, :uuid, :rang)");
$addUser_Statement->bindParam("name", $checkvcode_result['name']);
$addUser_Statement->bindParam("password", $pwhash);
$addUser_Statement->bindParam("uuid", $checkvcode_result['uuid']);
$addUser_Statement->bindParam("rang", $checkvcode_result['rang']);
$addUser_Statement->execute();
?>
<div class="alert alert-success" role="alert"><button type="button" class="close" data-dismiss="alert">×</button><p class="text-center">Freischaltung Erfolgreich durchgeführt!</p></div>
<p class="center">Dein Account wurde Erfolgreich Freigeschaltet. <br>
Du kannst dich nun mit deinem Benutzernamen(<?php echo $username; ?>) Anmelden. <br>
Solltest du dein Passwort vergessen, dann kannst du Ingame mit '/ucp pwrenew' ein neues Passwort erstellen. <br><br><br>
<a href="?p=login">Jetzt Anmelden.</a>
</p>
<?php
} else { ?>
<div class="alert alert-danger" role="alert"><button type="button" class="close" data-dismiss="alert">×</button><p class="text-center">Die eingegebenen Passwörter stimmen nicht überein!</p></div>
<form class="col-md-6 offset-md-3" action="?p=register" method="post">
<div class="form-group">
<label>Benutzername</label>
<input type="text" name="username" class="form-control disabled" value="<?php echo $username; ?>" disabled>
<p style="font-size: 12px; Color: red;">Hinweis: Dein Benutzername ist der Name des Verknüpften MineCraft-Accounts. Diesen Namen kannst du <b>NICHT</b> mehr ändern!</p>
</div>
<div class="form-group">
<label>Passwort</label>
<input type="password" name="password" class="form-control is-invalid" required>
<div class="invalid-feedback">
Passwörter stimmen nicht überein!
</div>
</div>
<div class="form-group">
<label>Passwort wiederholen</label>
<input type="password" name="password_repeat" class="form-control is-invalid" required>
<div class="invalid-feedback">
Passwörter stimmen nicht überein!
</div>
</div>
<div class="form-group">
<input type="submit" name"step2" class="btn btn-outline-primary" value="Registrieren">
</div>
</form>
<?php
}
} else { ?>
<form class="col-md-6 offset-md-3" action="?p=register" method="post">
<div class="form-group">
<label>Benutzername</label>
<input type="text" name="username" class="form-control disabled" value="<?php echo $username; ?>" disabled>
<p style="font-size: 12px; Color: red;">Hinweis: Dein Benutzername ist der Name des Verknüpften MineCraft-Accounts. Diesen Namen kannst du <b>NICHT</b> mehr ändern!</p>
</div>
<div class="form-group">
<label>Passwort</label>
<input type="password" name="password" class="form-control is-invalid" required>
<div class="invalid-feedback">
Passort zu kurz. Mindestens 8 Zeichen werden benötigt!
</div>
</div>
<div class="form-group">
<label>Passwort wiederholen</label>
<input type="password" name="password_repeat" class="form-control is-invalid" required>
</div>
<div class="form-group">
<input type="submit" name"step2" class="btn btn-outline-primary" value="Registrieren">
</div>
</form>
<?php
}
}
} else {
echo '<form class="col-md-6 offset-md-3" action="?p=register" method="post">
<div class="form-group">
<label>Verifizierungscode:</label>
<input type="text" name="vcode" class="form-control" required>
<a href="?p=faq&c=vcode" style="Font-Size: 12px; Color: green;">Klicke hier um zuerfahren wie du einen Code bekommst.</a>
</div>
<div class="form-group">
<input type="submit" name="step1" class="btn btn-outline-primary" value="weiter">
</div>
</form>';
} ?>
Hoffe wer kann helfen und schon mal danke für die antworten
Kommentar