How to make every X impressions a certain page appears only to that person???

Discussion in 'Programming' started by snapplekid13, Apr 6, 2007.

  1. #1
    I was thinking of adding this to a website of mine for a promo....

    How would you do this?

    Like every 500,000 impressions ( sitewide ) the page is redirected....
     
    snapplekid13, Apr 6, 2007 IP
  2. giraph

    giraph Guest

    Messages:
    484
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Using mysql you could create a table with a field named impressions. Increase the value of the impressions field everytime someone visits any page. Then check to see if it is equal to 500,000. If it is, reset it to 0, and use php like
    
    <?php header("Location: http://www.google.com"); ?>
    
    PHP:
     
    giraph, Apr 6, 2007 IP
  3. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #3
    yup, probably the most reliable way would be to use a DB as yoru datasource, then just increment a number - then modulus for 500,000 and if it = 0, then do what you gotta do :)
     
    ccoonen, Apr 6, 2007 IP