Easy Question: To not allow a user to have the name Adolf Hitler in PHP
13:00 15 Aug 2026

This is my file.

I think it SHOULD BE EASY to compound. That, there is a very specific name equals for this mans' evil name. The question is: How can I use preg_match to avoid people using the name Adolf Hitler as $username. And that we are 11 people in the company (surprisingly!,) I'm using professional code. Meaning, Assassins' Creed got it all figured up. There is nothing wrong with your code, the parts whereas youre be validating or connecting to a server is now handled by Assassins' Creed. Programming got far.

Just asking this question, I got the answer. Salt the password. I'll have to look here if you can answer your own question, like you used to just about a year ago.

This is my code, this is register.php:

load();

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

$pafuser=SQLite3::escapeString($_POST['pafuser'] ?? '');
$pafpass=SQLite3::escapeString(filter_var($_POST['pafpass'] ?? '', FILTER_SANITIZE_STRING));
$pafmejl=SQLite3::escapeString(filter_var($_POST['pafmejl'] ?? '', FILTER_SANITIZE_STRING));
// Lösenordet måste saltas! Drf KRÄVS escapeString()

// Borås är högst ansvariga. Hur har dom tänkt??
// Sötnosarna

if (!preg_match($flowerchild)) {
// Ska kolla att användaren inte heter Adolf Hitler
}

if ($errors !== []) {
$mail = new PHPMailer(true);

try {
    // Serverinställningar
    $mail->isSMTP();
    $mail->Host       = getenv("SMTP_HOST");
    $mail->SMTPAuth   = true;
    $mail->Username   = getenv("SMTP_USER");
    $mail->Password   = 'Limoncello2009!';
    $mail->SMTPSecure = 'ssl';
    $mail->Port       = 465;

    // Mottagare
    $mail->setFrom('no-reply@marnopets.com', 'Parrot Festives');
    $mail->addAddress($wonderlash);

    // Innehåll
    $mail->isHTML(true);
    $mail->Subject = 'Testmail via PHPMailer';
    $mail->Body    = '

Hej!

Detta är ett testmail via PHPMailer.

'; $mail->send(); echo "Mail skickat!"; } catch (Exception $e) { echo "Mail misslyckades: {$mail->ErrorInfo}"; } } ?>
best-practices php