how do you make an audio widget play only on the first visit to my site?

Discussion in 'Programming' started by LoanShark, Jun 22, 2009.

  1. #1
    I don't know much about video. I have a Soudboard widget that I would like to play when someone comes to my site for the first time. Can it be set up to recognize the cookies and not play on subsequent visits? Is there a way to manipulate the code to do this?
     
    LoanShark, Jun 22, 2009 IP
  2. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    if !cookie { embed video }
     
    ansi, Jun 22, 2009 IP
  3. misbah

    misbah Active Member

    Messages:
    265
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    68
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    or you can save IP address from your visitor on database, and enable video if database didn't have data from your visitor.
     
    misbah, Jun 22, 2009 IP
  4. LoanShark

    LoanShark Peon

    Messages:
    118
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    Ansi, what do you mean by that? if !cookie { embed video }
     
    LoanShark, Jun 22, 2009 IP
  5. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    basically it's pseudocode describing a method to do what it is you want to do. if the cookie isnt set, embed the video.

    php code would look something like this:

    
     <?php if( !isset( $_COOKIE['myvideohasbeenshown'] ) ) { set cookie... embed video .... } ?>
    
    PHP:
     
    ansi, Jun 22, 2009 IP
  6. LoanShark

    LoanShark Peon

    Messages:
    118
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    Ansi thanks for your help. I do believe that this is over my head.
     
    LoanShark, Jun 22, 2009 IP
  7. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #7
    msg me if you want and ill do it for like $20. im sure you can find someone to do it for $1 on here though but i'm not a beginner and i have to earn a living as a freelancer. it's up to you. my normal rate is $65/hour with a minimum of 1 hour but since this only like 5 minutes of work or less, $20 seems plenty fair to me. like i said if that is too much, someone will do it for a buck or two. :)
     
    ansi, Jun 22, 2009 IP