SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 26
  1. #1
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Identifying the 2 millionth visitor?

    Hey everyone...I have a great idea for a giveaway on one of my client sites (www.plusoneonline.com). This site is nearing it's 2 millionth visitor soon (within a month or a few weeks).

    I want to see if it is possible to write some sort of script that would identify the 2 millionth person and get their details. Maybe some sort of popup window right at the 2,000,000 mark or something?

    I am totally open to ideas but I wanted to ask this now so I can get the great minds here working on it.

    The site is done using php/mysql so I do have that open to me. I also already have a counter in place. I am checking with my hosting company to see if that file can be read by a PHP script. (I'll let you know)

    So, please fire up your coding engines and help me out!
    Cheers all and have a great night!!!

    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  2. #2
    You want what? By when?? Milamber's Avatar
    Join Date
    Jan 2001
    Location
    California
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just so you know, people generally *dont* write an entire script for you just because you ask nice. Most people take money though.



    However, to help you out (and whoever might do this) how do you know that your getting to the 2 billionth user? (or whatever user)


    Secondly, once you know how you get that, it's a simple matter of loading a script on the index page that goes out to whatever says what number the visitor is, and then it goes on to either give them the special pop up via adding the javascript to the page, or it just does the normal page.
    -Jeff Minard | jrm.cc - Battlefield 2 Stats

  3. #3
    SitePoint Evangelist Umair.ms's Avatar
    Join Date
    Sep 2000
    Location
    Lahore, Pakistan
    Posts
    567
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Instead of popping up a window. Display the message to the visitor INSTEAD of the actual homepage AND store a cookie in his browser. So that if he disconnects (dial-up) or has another problem - he still has access to his prize.
    TinyPlanet.org
    Discuss and Debate World Events, Politics and Religion.
    Interact and Share your Views with People around the Globe.

  4. #4
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's what I'm asking for help here folks. I don't know enough coding to do it myself. If I need to pay someone I would (if the project gets approved from my client). I just wanted to ask here first.

    As for knowing who the 2 millionth person is, that's why I'm posting. I want to find out what the best way would be. I mentioned that I already have a counter that might be able to be accessed from a script.

    Cookies might be a good way of doing it. I just don't know.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  5. #5
    You want what? By when?? Milamber's Avatar
    Join Date
    Jan 2001
    Location
    California
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no seriously, if anyones to help, we'd really need to know how you keep track of the people. If you're using a mysql database to log users and you can use that, peachy, however, if you are using a counter from some third party system, they aren't going to be very forth coming (usually) to give you access to let you interface with their system to know when you actually get that ##th visitor.
    -Jeff Minard | jrm.cc - Battlefield 2 Stats

  6. #6
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's the bet the 2millionth visitor is the googlebot?

  7. #7
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK...there is a backend php/mysql but it is not used (that I know of) to log a user.

    There is a counter that I use from my hosting company. I don't know exactly how it works, but I think it just simply updates a text file. I have asked my hosting company to see if there is a way to access that counter file but I have not heard back from them yet.

    Like I said before, this is why I am coming to you guys. I don't know what the best way is. I would like to hear some ideas.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  8. #8
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The script would work like this.

    Page request.

    PHP checks to see if the last user was user 1999999 (read your log file)

    PHP checks another file for a marker.

    If no marker exists php adds a marker to that file and gives this page request the status of winner.

    php adds this person's request to the log.

    conditional statement if status = winner

    php logs all the winner information in the marker file and redirects the user to a new page with winner information.



    It all hinges on reading your log file of course, which if its big could be quite a process. If your site is popular it is very likely that 2 visitors or more could arrive and be seen as user 1999999 since all you're doing is reading to the file, the real test is who can write first. So thats why you have the marker file. 2 or more people can read from a file at the same time, especially a log file since it'll be so long. But only one will be the first person to write to the marker file.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  9. #9
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds good...would there be a better mehod of checking to see if the person is the "winner"?

    I'm open to suggestions.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  10. #10
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could use sessions since the session is good for the entire visit. So each time a new session starts you could log a visit to a table, you could then check that table for 2,000,000 if that tis the current visit you could use PHP to write some javascript to open a window on page load to notify the visitor of their fame and fortune.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  11. #11
    SitePoint Evangelist ucahg's Avatar
    Join Date
    Apr 2001
    Location
    Sarnia, Ontario, Canada
    Posts
    434
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Not popups

    I personally wouldn't recommend using a popup ad, as a lot of people close popups before they even load (if they have a slow connection) or read them, because they assume the popup is an ad.

    Even if the popup says "You have won a prize!" in the title bar, they may still think it's an ad.

  12. #12
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    good point.

    I think the idea of redirecting the appropriate user to a special page is the best bet.

    Now, let me say first that I would plan on telling the users about this beforehand. It would build traffic as well as make them pay more attention to anything out of the ordinary.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  13. #13
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A simple way to achieve what you are asking for is to implement a really basic counter in your script. (Don't know how you count your visitors now.

    For instance, create count.inc and place the numbre of vistitors you had so far in it,
    open file
    save the text of the file as $num
    do $num++;
    store new numbre in file
    add an
    if ($num == 2000000) {
    echo 'Your one lucky son of a *****!!!';
    }

    This is the easyest way to do this.

  14. #14
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have won a prize!
    Then i would be really, really sure it's an ad!

  15. #15
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    in case you didn't know here is how you'd want to redirect them in your php.

    header("Location: http://www.domain.com/youwon.html");
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  16. #16
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by dijksma
    Then i would be really, really sure it's an ad!

    LMAO

  17. #17
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone else have any ideas on this? I might be willing to offer a gift certificate if someone gave me a hand.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  18. #18
    will code HTML for food Michel V's Avatar
    Join Date
    Sep 2000
    Location
    Corsica
    Posts
    552
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by dijksma
    A simple way to achieve what you are asking for is to implement a really basic counter in your script. (Don't know how you count your visitors now.

    For instance, create count.inc and place the numbre of vistitors you had so far in it,
    open file
    save the text of the file as $num
    do $num++;
    store new numbre in file
    add an
    if ($num == 2000000) {
    echo 'Your one lucky son of a *****!!!';
    }

    This is the easyest way to do this.
    Well, Creole, I guess you got the picture there
    Just to add to this, so it doesn't count 10 visitors if the same visitor is visiting the page 10 times in a short while, you might want to add some session stuff there
    Once you got your session part done, it's as easy as calling an user-defined function to do what dijksma explained.
    [blogger: zengun] [blogware contributor: wordpress]

  19. #19
    SitePoint Member LauraK_18's Avatar
    Join Date
    May 2001
    Location
    Kentucky
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just thought I'd mention- Awesome idea for contest creole *grinz* Maybe i'll find a way to track the visitors and come in on 2 million- HAHA! I wish
    Webmaster
    www.plusoneplanet.com
    www.tvguide.cjb.net
    Halo Promotions (Coming soon)

  20. #20
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Watch it now girlie!

    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  21. #21
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Have you received any help from the people with the tracking file?

  22. #22
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I will ask my hosting company about it again.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  23. #23
    SitePoint Guru
    Join Date
    Dec 2000
    Location
    Karachi, Pakistan
    Posts
    913
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any progress yet creole ??

    Just curious..
    36Host.com - $36/year web hosting [affiliates earn 30%]
    * Affordable Small Business Web Hosting since 2003! *
    "500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
    mysql, pre-installed php scripts, 24/7 support & more...."



  24. #24
    SitePoint Member
    Join Date
    Jul 2001
    Location
    Kingston, Ontario, Canada
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    The solution to your problems!

    Since you will most likely be given some excuse by your hosting company about why they wont allow you to use their counter, I would propose that you do this:

    - Create the prize page, or whatever, like the other posts have suggested
    - Create a simple counter of your own, using Perl, PHP, or whatever you have available, and syncronize it with the counter you're using from your hosting company (when you're ready to launch it, set the starting number to the number on the host's counter)
    - Create a simple script that reads that counter file you've created each time the page loads, and if it reads 2000000, then redirect the page to the prize page

    This could be done in a few hours by most programmers.

    Hope it works out for you!

    David
    David W. Cook
    DCSun Internet Technologies
    http://www.dcsun.com

  25. #25
    SitePoint Addict
    Join Date
    Apr 2001
    Location
    Michigan
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I'd be careful though.

    I would make sure that its a unique ip address, or track the user using a cookie or sessions, and make the winning page a hard to guess page name, because if people know your doing this, they could try to guess the name of the webpage. If the page is you.html, and someone guess that, you might have a problem.


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
  •