Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. <?php
  2.  
  3. if (!isSet($_COOKIE['dane']) && !isSet($_POST['nazw'])){
  4.  
  5. ?>
  6.  
  7. <!DOCTYPE HTML>
  8. <html>
  9. <head>
  10. <title>Dane_user</title>
  11. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  12. </head>
  13. <body>
  14. <form action="ciacho.php" method="post">
  15. <p>Podaj imię i nazwisko: </p>
  16. <input type="text" name="nazw" placeholder="Imię i nazwisko" size="35">
  17. <p><input type="submit" value="Wyślij" name="wyslij"></p>
  18. </form>
  19. <?php
  20. }
  21.  
  22. else {
  23. if(isSet($_POST['nazw']))
  24. {
  25. setcookie('dane', $_POST['nazw'], time()+60*60*24*365);
  26. echo "<p>Dziękujemy za wprowadzenie danych</p>";
  27. }
  28. else{
  29. echo "<p>Witamy po raz kolejny! " . $_COOKIE['dane']. "</p>";
  30. }
  31. }
  32. ?>
  33. </body>
  34. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement