SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a guestbook and before my guests can come into the guestbook they must agree with my rules, i want to make some sort of cookie so that my visitors only have to go through the gateway once, can somone here make me the code i need for that, because i know its easy to make if you know how.

  2. #2
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <?
    if(!$read_the_rules){setcookie("read_the_rules",1,time()+12960000);header("location:rules.html");}else{setcookie("read_the_rules",1,time()+31260000);}
    ?>

    that would have to be at the very top of your page - the very top!

    as long as they have visited with the last 6 months & assuming they have cookies enabled - that should do the job.

  3. #3
    imagine no limitations exbabylon's Avatar
    Join Date
    Dec 2000
    Location
    Idaho, USA
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it would behoove you to declare the variables... it will work, but sometimes things can come up... it's just a good idea!

    PHP Code:
    $read_the_rules "$HTTP_COOKIE_VARS[agree]";
    if(
    $read_the_rules != ""){
    setcookie("read_the_rules",1,time()+12960000);
    header("location:rules.html");
    }else{
    setcookie("read_the_rules",1,time()+31260000);} 

    Blamestorming: Sitting around in a group discussing why a deadline was missed or a project failed and who was responsible.

    Exbabylon- Professional Internet Services


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •