PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php <html> <head> <title>Форма</title> <meta charset="utf-8"> <style> body { font-family: Arial, sans-serif; background-color: #f4f4f9; margin: 0; padding: 20px; display: flex; flex-direction: column; align-items: center; } form { background-color: #ffffff; padding: 20px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); max-width: 300px; width: 100%; } form input { display: block; width: calc(100% - 20px); margin: 10px 0; padding: 10px; font-size: 14px; border: 1px solid #ddd; border-radius: 4px; } form button { background-color: #007bff; color: #ffffff; border: none; padding: 10px; font-size: 14px; border-radius: 4px; cursor: pointer; width: 100%; } form button:hover { background-color: #0056b3; } .output { margin-top: 20px; padding: 15px; background-color: #e9ecef; border-radius: 8px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); max-width: 300px; width: 100%; text-align: center; font-size: 16px; color: #333; } </style> </head> <body> <form method="post"> <input type="text" name="name" placeholder="Имя"> <input type="number" name="age" placeholder="Возраст"> <button type="submit">Отправить</button> </form> <?php if ($_POST) { $name = htmlspecialchars($_POST["name"]); $age = htmlspecialchars($_POST["age"]); echo "<div class='output'>Привет, $name! Тебе $age лет.</div>"; } ?> </body> </html>
Show:  
Copy Clear