<?php
    
    if ($_SERVER['REQUEST_METHOD'] == "POST") {
    
        if (isset($_POST['firstname'], $_POST['lastname'])) {
                
            echo htmlspecialchars($_POST['firstname']);
            echo htmlspecialchars($_POST['lastname']);
        }
    } else {

        header('Location: https://webetu.iutrs.unistra.fr/~clement.krebs/tp1/formulaire.html');
    }
