gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
Code source en PHP du formulaire authentification
- User
Code source en PHP du formulaire authentification
- Assistant
Voici un exemple de code source PHP pour un formulaire d'authentification basique :
<?php // Vérification des données renvoyées par le formulaire if ($_SERVER["REQUEST_METHOD"] == "POST") { $username = $_POST["username"]; $password = $_POST["password"]; // Vérifier l'authentification if ($username == "admin" && $password == "password") { // Redirection vers la page après l'authentification réussie header("Location: dashboard.php"); die(); } else { $message = "Identifiant ou mot de passe incorrect."; } } ?> <!DOCTYPE html> <html> <head> <title>Formulaire d'authentification</title> </head> <body> <h1>Authentification</h1> <?php if (isset($message)) { ?> <p><?php echo $message; ?></p> <?php } ?> <form method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?>"> <label for="username">Nom d'utilisateur:</label> <input type="text" id="username" name="username" required><br> <label for="password">Mot de passe:</label> <input type="password" id="password" name="password" required><br> <input type="submit" value="Se connecter"> </form> </body> </html>
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.