Voting

: seven plus one?
(Example: nine)

The Note You're Voting On

admin at monkacres dot se
5 months ago
Now, it needs to print, $sanitized_a prior to running the query $query or $ar

And, as I found out that redoing is no bogus. What is the answer to this mere question? And also, to be WWF-friendly; make a game about an endangered animal like chinchillas

<?php
// I solved the
// Redo, until it works!
include('db/db.php');

$UserName=$_POST['UserName'];
$EmailVerify=$_POST['EmailVerify'];
$PassPhrase1=$_POST['PassPhrase1'];

while (@isset($UserName, $PassPhrase1) and $_POST['submit'] AND !empty($EmailVerify)) {
if (@strlen($UserName) >= 22) {
$error="Användarnamnet får vara max 22 bokstäver långt!";
break;
}
if (@strlen($PassPhrase1) < 8) {
$error="Lösenordet måste vara minst åtta tecken långt!";
break;
}

$sanitized_a=filter_var($EmailVerify, FILTER_SANITIZE_EMAIL);
if (@filter_var($sanitized_a, FILTER_VALIDATE_EMAIL)) {
$message="Email unfiltered: ".$EmailVerify;
$message="Email filtered: " .$sanitized_a;
break;
// To show this before entering the query, also have a sleep on 1 sec for the query
}

if (@isset($UserName, $PassPhrase1) AND $_POST['submit'] AND !empty($EmailVerify)) {
$query="INSERT INTO users (UserName, EmailVerify, PassPhrase1) VALUES (?,?,?) SLEEP(1)";
$ar=$conn->prepare($query);
$ar->execute([$UserName, trim($sanitized_a), password_hash($PassPhrase1, PASSWORD_BCRYPT)]);
$message="Du har skapat ett konto!";
break;
}
}
?>
<!DOCTYPE HTML/>
<HTML/>
<HEAD/>
<META NAME="robots" CONTENT="noindex"/>
<!-- Latest compiled and minified CSS -->
<LINK HREF="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" REL="stylesheet"/>
<TITLE/>MonkAcres.se || vPetSim</TITLE>
<!--The robots stops at registering-->
<STYLE/>
body, html {
text-align: center !important;
}
form {
width: 75% !important;
margin: auto !important;
}
</STYLE>
</HEAD>
<BODY/>
<H1/>MonkAcres.se</H1>
<!--Gonna be adding Bootstrap 5 here!-->

<?php if (!empty($error) || !empty($message)): ?>
<DIV CLASS="alert alert-info"/>
<!--Parse error!-->
<?php if (isset($error)): ?>
<?php print $error; ?>
<?php endif; ?>
<?php if (isset($message)): ?>
<?php print $message; ?>
<?php endif; ?>
</DIV>
<?php endif; ?>

<FORM METHOD="POST"/>
Anv&auml;ndarnamn:<BR/>
<INPUT TYPE="text"     NAME="UserName" CLASS="form-control" REQUIRED/><BR/>
Epost:<BR/>
<INPUT TYPE="email"    NAME="EmailVerify" CLASS="form-control" REQUIRED/><BR/>
L&ouml;senord:<BR/>
<INPUT TYPE="password" NAME="PassPhrase1" MINLENGTH="8" CLASS="form-control" REQUIRED/><BR/>
<INPUT TYPE="submit"   NAME="submit" VALUE="Skapa konto!"/>
</FORM>
<FOOTER DEFER/>
&copy;&nbsp;2026-9999 MonkAcres.se, AB
</FOOTER>
</BODY>
</HTML>

(As a finalize-note: $message on line 22 should differ to $message on line 23.)

<< Back to user notes page

To Top