If cookie found show URL if not show text script?

Discussion in 'PHP' started by Seqqa, Nov 4, 2008.

  1. #1
    Basically as the title says I'm after a script that when it's found a cooke shows a live link and then when it isn't found shows a text message.

    + rep for script! :)
     
    Seqqa, Nov 4, 2008 IP
  2. Christian Little

    Christian Little Peon

    Messages:
    1,753
    Likes Received:
    80
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    if (isset($_COOKIE['whatever'])) {
       echo "You have a cookie set";
    } else {
       echo "You don't have a cookie set";
    }
    
    PHP:
    Just chance $_COOKIE['whatever'] to use whatever cookie variable name you are looking for, then change the 2 echo statements.
     
    Christian Little, Nov 4, 2008 IP
    Seqqa likes this.