Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>cookies</title>
  8. </head>
  9. <body>
  10.  
  11. <?php
  12. if(isset($_POST["imie"])){
  13. $imie = $_POST["imie"];
  14. } else {
  15. $imie = "";
  16. }
  17.  
  18.  
  19. setcookie("imie",$imie);
  20.  
  21. if(isset($_COOKIE["imie"])){
  22. echo "ciastko: ".$_COOKIE["imie"];
  23. }
  24.  
  25. ?>
  26.  
  27. <form action="index.php" method="post">
  28. podaj imie: <input type="text" name="imie" id="Imie">
  29. <button type="submit">Wyslij</button> <button type="reset">wyczysc</button>
  30. </form>
  31.  
  32.  
  33. </body>
  34. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement