Advertisement
sanjiisan

Untitled

Apr 5th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. <?php
  2.  
  3. if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  4. if (isset($_POST['surname']) && isset($_POST['name'])) {
  5. $name = trim($_POST['name']);
  6. $surname = trim($_POST['surname']);
  7. }
  8. }
  9.  
  10. ?>
  11. <!doctype html>
  12. <html lang="en">
  13. <head>
  14. <meta charset="UTF-8">
  15. <meta name="viewport"
  16. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  17. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  18. <title>Zadanie 1</title>
  19. <!-- Latest compiled and minified CSS -->
  20. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  21. </head>
  22. <body>
  23. <div class="container">
  24. <div class="row">
  25. <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
  26. <?php
  27.  
  28. if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  29. echo 'Cześć witaj: ' . $name . ' ' . $surname;
  30. }
  31.  
  32. ?>
  33. </div>
  34. </div>
  35. <div class="row">
  36. <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
  37. <form action="index.php" method="post" role="form">
  38. <legend>Name and surname</legend>
  39. <div class="form-group">
  40. <label for="name">Name</label>
  41. <input type="text" class="form-control" name="name" id="name" placeholder="Name...">
  42. </div>
  43. <div class="form-group">
  44. <label for="surname">Surname</label>
  45. <input type="text" class="form-control" name="surname" id="surname" placeholder="Surname...">
  46. </div>
  47. <button type="submit" class="btn btn-primary">Say Hello!</button>
  48. </form>
  49. </div>
  50. </div>
  51. </div>
  52. </body>
  53. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement