Advertisement
pelek0

cookies - setcookie (wartość się zwiększa)

Jan 27th, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. //Wartość się zwiększa co odświeżenie przeglądarki
  2. <!DOCTYPE html>
  3. <html>
  4.  
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <title>Bez tytułu 1</title>
  8. </head>
  9.  
  10. <body>
  11. <?php
  12.     if(isSet($_COOKIE['ile']))
  13.         $ile=$_COOKIE['ile'];
  14.     else
  15.         $ile=0;
  16.     setcookie('ile',++$ile);
  17.     print($ile);
  18.    
  19. ?>
  20.  
  21. </body>
  22.  
  23. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement