Setcookie() function question and if statement?

Discussion in 'PHP' started by tdd1984, Feb 11, 2012.

  1. #1
    I am trying to set a cookies in the users browser. So if they come back again after 5 days they will get redirect into another page. I know I can do this with an if statement, but confused on how to do it. Say the user visits a page today. Then the user comes back to the page 6 days later and beyond. They will get redirected into another page..

    How can I do this?
     
    tdd1984, Feb 11, 2012 IP
  2. ApocalypseXL

    ApocalypseXL Notable Member

    Messages:
    6,095
    Likes Received:
    103
    Best Answers:
    5
    Trophy Points:
    240
    #2
    Set the cookie on the first visit with an expiry time of 5 days have a function check for the cookie's existnace before HTML is sent and send the headers if the cookie is present .
     
    ApocalypseXL, Feb 11, 2012 IP
  3. tdd1984

    tdd1984 Well-Known Member

    Messages:
    2,357
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    150
    #3
    Well I know that, but little confused on how to write it.
     
    tdd1984, Feb 11, 2012 IP