Загрузка данных


<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Форма</title>

    <style>
        body {
            color: white;
            -webkit-text-stroke: 0.5px black;
            font-family: impact;
            padding: 20px 700px;
            background: lightgreen;
        }

        form {
            max-width: 300px;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        input,
        textarea,
        button {
            background: lightblue;
            font-family: impact;
            padding: 8px;
        }

        .result {
            margin-top: 20px;
            padding: 10px;
            border: 1px solid #ccc;
            background: #;
        }
        footer {|
            text-align: center;
            padding: 20px;
            color: white;
            -webkit-text-stroke: 1px black;
            font-family: impact;
            background: blue;
            max-width: 377px;
            
        }
    </style>
</head>
<body>

    <h2>Регистрация</h2>

    <form method="POST">
        <input type="text" name="name" placeholder="Имя" required>
        <input type="tel" name="phone" placeholder="Телефон" required>
        <input type="email" name="email" placeholder="Почта" required>
        <textarea name="comment" placeholder="Комментарий" required></textarea>
        <button type="submit">Отправить</button>
    </form>

    <?php
if (isset($_SERVER["REQUEST_METHOD"]) && $_SERVER["REQUEST_METHOD"] == "POST") {
    if (!empty($_POST)) {
        $name = isset($_POST["name"]) ? htmlspecialchars($_POST["name"]) : '';
        $phone = isset($_POST["phone"]) ? htmlspecialchars($_POST["phone"]) : '';
        $email = isset($_POST["email"]) ? htmlspecialchars($_POST["email"]) : '';
        $comment = isset($_POST["comment"]) ? htmlspecialchars($_POST["comment"]) : '';
        
        echo "
        <div class='result'>
            <h3>Полученные данные:</h3>
            
            <p><strong>Имя:</strong> $name</p>
            <p><strong>Телефон:</strong> $phone</p>
            <p><strong>Почта:</strong> $email</p>
            <p><strong>Комментарий:</strong> $comment</p>
        </div>
        ";
    } else {
        echo "<p>Нет отправленных данных.</p>";
    }
}
?>
    <footer>
        <a href="https://freeimage.host/"><img src="https://iili.io/BbYTNae.jpg" alt="BbYTNae.jpg" border="0" /></a>
        <h2> И СОЗДАЛ ЧИПСЫ 2 <h2>
    <footer>

</body>
</html>