Facebook
From ja, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 258
  1. <?php
  2. if (isset($_COOKIE['imie']) && isset($_COOKIE['nazw']))
  3. {
  4.         $dane[0]=$_COOKIE['imie'];
  5.         $dane[1]=$_COOKIE['nazw'];
  6. }
  7.  
  8. if (isset($_GET['zapisac']))
  9. {
  10.         $dane[0]=$_GET['imie'];
  11.         $dane[1]=$_GET['nazw'];
  12.         setcookie("imie",$dane[0],time()+20);
  13.         setcookie("nazw",$dane[1],time()+20);
  14.         //print("$dane[0] $dane[1]");
  15. }
  16.  
  17.  
  18. ?>
  19. <html>
  20. <form name="formularz">
  21. Imię <input type="text" name="imie" value='<?php if (isset($dane[0])) print ($dane[0]); ?>'/><br>
  22. Nazwisko <input type="text" name="nazw" value='<?php if (isset($dane[1])) print ($dane[1]); ?>'/><br>
  23. <input type="checkbox" name="zapisac" />Czy zapamietac dane w cookie?
  24. <br><input type="submit">
  25. </form>
  26. </html>