peshopbs2

simple get request demo with form

Aug 28th, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="utf-8" />
  5.     <title>Yet another PHP</title>
  6. </head>
  7. <body>
  8.     <?php
  9.     if(isset($_GET["name"])) {
  10.         echo "<h1>Здравей, ".$_GET["name"]."</h1>";
  11.     } else {
  12.         ?>
  13.         <form action="index.php" method="get">
  14.             <label for="name">Моля въведете името си</label>
  15.             <input type="text" name="name" value="" id="name" />
  16.             <input type="submit" value="Изпрати" />
  17.         </form>
  18.         <?php
  19.     }
  20.     ?>
  21. </body>
  22. </html>
Advertisement
Add Comment
Please, Sign In to add comment