Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 14th, 2012  |  syntax: None  |  size: 0.33 KB  |  hits: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. php checking cookie to set another cookie
  2. setcookie("Blah","user",time()+86400);
  3.        
  4. if (isset($_COOKIE["Blah"]))
  5.     {
  6.         setcookie("Demo","user",time()+86400);
  7.     }
  8. $url="cd/bar/home.php"
  9. header ("Location: $URL");
  10.        
  11. <?php
  12. if (isset($_COOKIE["Demo"]))
  13. {
  14. ?>
  15. html
  16. <?php
  17. }
  18. ?>
  19.        
  20. setcookie("Demo","user",time()+86400, '/');