more changes to register since misleading errors and disabled resubmitting the form when username is already taken and when password confirmation is wrong
This commit is contained in:
parent
b8253c425f
commit
8923aaacaa
|
|
@ -19,6 +19,11 @@ if(isset($_POST['submit'])) {
|
||||||
$username = $_POST['username'];
|
$username = $_POST['username'];
|
||||||
$password = $_POST['pass'];
|
$password = $_POST['pass'];
|
||||||
$passwordconfirm = $_POST['passconfirm'];
|
$passwordconfirm = $_POST['passconfirm'];
|
||||||
|
echo '<script>
|
||||||
|
if ( window.history.replaceState ) {
|
||||||
|
window.history.replaceState( null, null, window.location.href );
|
||||||
|
}
|
||||||
|
</script>';
|
||||||
$user = new User($con, $user->getID($con, $username));
|
$user = new User($con, $user->getID($con, $username));
|
||||||
if ($password == $passwordconfirm) {
|
if ($password == $passwordconfirm) {
|
||||||
$passwordconfirmiswrong = false;
|
$passwordconfirmiswrong = false;
|
||||||
|
|
@ -69,7 +74,7 @@ $thefunfact = json_decode($result);
|
||||||
} else {
|
} else {
|
||||||
echo "form-control form-control-sm";
|
echo "form-control form-control-sm";
|
||||||
} ?>" type="text" placeholder="Your username" id="inputSmall" for="inputValid" name="username">
|
} ?>" type="text" placeholder="Your username" id="inputSmall" for="inputValid" name="username">
|
||||||
<?php if($userexists == true) { echo '<div class="invalid-feedback" bis_skin_checked="1">Password Confirmation field is invalid.</div>'; } ?>
|
<?php if($userexists == true) { echo '<div class="invalid-feedback" bis_skin_checked="1">Username is already taken.</div>'; } ?>
|
||||||
<label class="col-form-label col-form-label-sm mt-4 password text-light" for="inputSmall">Password</label>
|
<label class="col-form-label col-form-label-sm mt-4 password text-light" for="inputSmall">Password</label>
|
||||||
<input class="<?php if($passwordconfirmiswrong == true) {
|
<input class="<?php if($passwordconfirmiswrong == true) {
|
||||||
echo "form-control is-invalid";
|
echo "form-control is-invalid";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue