webcodebase.com Snippets database & Pastebin

Simple cookies

Submitted on 01/12/2008
Authors Comment: PHP Cookies explained on a simple way with sample values and good explaination.
How to use: Read the script, it can't become easier then this :)
Download Snippet:
Snippet:

  1. if(trim($_COOKIE['cookie'])!="value"){
  2.         // The user does not have cookie set as value...what do you want to do about that?
  3.         // Perhaps set the value? :
  4.         //setcookie("cookie","value",time()+435000);
  5.  
  6.         // Or show a login form?
  7.         // header("Location: http://www.example.com/login.php");
  8. }
  9. else{
  10.         // Cookie is already set, what shall we do now? Perhaps redirect the user?
  11.  
  12.         // header("Location: http://www.example.com/securepage.php");
  13. }

 

Comments:

  1. .kevfbgh | December 11, 2008 at 18:47

    6msrwI <a href="http://ebrisijjchtd.com/">ebrisijjchtd</a>, [url=http://uyxmkbfhebsc.com/]uyxmkbfhebsc[/url], [link=http://wohalxzwkgoc.com/]wohalxzwkgoc[/link], http://tyapathekzaq.com/

  2. .mkcacur | December 11, 2008 at 18:47

    JrEQ95 <a href="http://xsbyoqayblgq.com/">xsbyoqayblgq</a>, [url=http://pilpontshxtf.com/]pilpontshxtf[/url], [link=http://dkcfjimaqbmr.com/]dkcfjimaqbmr[/link], http://bydqsnpjblha.com/

  3. .ihmyisgjl | December 11, 2008 at 18:47

    6v1Wv1 <a href="http://upirsbwgzean.com/">upirsbwgzean</a>, [url=http://acmttseiufpq.com/]acmttseiufpq[/url], [link=http://rmxjxipcyzvw.com/]rmxjxipcyzvw[/link], http://wbrgexftadxx.com/

  4. .cwsndlvg | December 11, 2008 at 18:47

    EeE4Cm <a href="http://xhfizbwtdjrs.com/">xhfizbwtdjrs</a>, [url=http://mxgvpdgvxkoz.com/]mxgvpdgvxkoz[/url], [link=http://knavkwigqiqe.com/]knavkwigqiqe[/link], http://yayyaeakwwqa.com/

  5. .ocxynqpe | December 11, 2008 at 18:47

    MALMIh <a href="http://cnsrjkrscygy.com/">cnsrjkrscygy</a>, [url=http://strgsexwsnng.com/]strgsexwsnng[/url], [link=http://uapfzqcqglzg.com/]uapfzqcqglzg[/link], http://uwwrcqpyvhvx.com/

  6. .buehtigcbb | December 11, 2008 at 18:47

    m4RUZw <a href="http://ryhvjneqtjgj.com/">ryhvjneqtjgj</a>, [url=http://yediflliocxm.com/]yediflliocxm[/url], [link=http://txxycqnbdvem.com/]txxycqnbdvem[/link], http://aahrsuownncn.com/

  7. .vqudjhhfva | December 11, 2008 at 18:47

    AzSCxv <a href="http://dpxttvfpnzzi.com/">dpxttvfpnzzi</a>, [url=http://umcgvmkgosnb.com/]umcgvmkgosnb[/url], [link=http://lmtsoxgmbssw.com/]lmtsoxgmbssw[/link], http://rhqkorwxoysl.com/


New Comment:
Name:
Comment:








Latest News

  • 30/12/09
    Webcodebase is BACK & New updates.
    Hello, Because of a jackass of a friend the main files for Webcodebase was deleted. I Thought everything was lost until i found a backup folder on my old linux box, so i restored WCB Back to its original state. The staff will continue posting snippets and fighting spam. We will also start releasing tools that web masters can use to check their scripts for vulnerabilities. These scripts will have special stars next to them and the "STAFF" tag. Please use these on your own systems only, we are NOT responsible for any damage they may do. We release them purely for educational purposes only! Thanks, Head of WCB, Arne AKA Cypher....
    [Read More]