Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($_SERVER['REQUEST_METHOD'] === 'POST') {
- if (isset($_POST['surname']) && isset($_POST['name'])) {
- $name = trim($_POST['name']);
- $surname = trim($_POST['surname']);
- }
- }
- ?>
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport"
- content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Zadanie 1</title>
- <!-- Latest compiled and minified CSS -->
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
- </head>
- <body>
- <div class="container">
- <div class="row">
- <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
- <?php
- if ($_SERVER['REQUEST_METHOD'] === 'POST') {
- echo 'Cześć witaj: ' . $name . ' ' . $surname;
- }
- ?>
- </div>
- </div>
- <div class="row">
- <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
- <form action="index.php" method="post" role="form">
- <legend>Name and surname</legend>
- <div class="form-group">
- <label for="name">Name</label>
- <input type="text" class="form-control" name="name" id="name" placeholder="Name...">
- </div>
- <div class="form-group">
- <label for="surname">Surname</label>
- <input type="text" class="form-control" name="surname" id="surname" placeholder="Surname...">
- </div>
- <button type="submit" class="btn btn-primary">Say Hello!</button>
- </form>
- </div>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement