Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title></title>
  6. </head>
  7. <body>
  8. <?php
  9. $cookie_name = "user3";
  10. $cookie_value = "John Doe";
  11. setcookie($cookie_name, $cookie_value); // 86400 = 1 day
  12.  
  13.  
  14. if(!isset($_COOKIE[$cookie_name])) {
  15. echo "Cookie named '" . $cookie_name . "' is not set!";
  16. } else {
  17. echo "Cookie '" . $cookie_name . "' is set!<br>";
  18. echo "Value is: " . $_COOKIE[$cookie_name];
  19. }
  20. ?>
  21.  
  22. </body>
  23. </html>
  24.  
  25. $cookie_name = "user3";
  26. $cookie_value = "John Doe";
  27. setcookie($cookie_name, $cookie_value);
  28.  
  29. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement