SitePoint Sponsor

User Tag List

Results 1 to 13 of 13

Thread: auction timer; how to trigger end of auction?

  1. #1
    Original Gangster silver trophy SitePoint Award Recipient Thing's Avatar
    Join Date
    Oct 2000
    Location
    Jackson, NJ
    Posts
    4,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    auction timer; how to trigger end of auction?

    I have a quick question I thought that somebody out there has probably been exposed to. I am creating a auction web site. I am using ASP on the front and SQL Server 2000 in the back. I am trying to figure out a way to get an auction to basically countdown until it reaches 0 seconds left, then to trigger a certain web page to tally who won.

    Example:

    Auction: HARLEY 2004 MOTORCYCLE
    Time: 5 days


    So in exactly 5 days or 120 hours the auction needs to know that it has ended and trigger a page to decide the winner. I've done a lot of searching with no luck, anyone have any ideas? Thanks

  2. #2
    Xbox why have you forsaken me? moospot's Avatar
    Join Date
    Feb 2001
    Location
    Clearwater, FL
    Posts
    3,614
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know Site Server Commerce Ed. had an auction component. Unfortunately, it's no longer available for download.

    Maybe you can set up something in your global.asa to query the server every so often and get a list of ended auctions and send out e-mails, run queries or do whatever you gotta do. Otherwise, I think you will need to look into SQL triggers. Check out 4GuysFromRolla.com

  3. #3
    Original Gangster silver trophy SitePoint Award Recipient Thing's Avatar
    Join Date
    Oct 2000
    Location
    Jackson, NJ
    Posts
    4,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Problem with using the global.asa is it could possibly use quite a bit a resources to check every few seconds. Has anyone used any of the components out there that you purchase to do this? That's about all I can come up with. Thanks!

  4. #4
    SitePoint Zealot TheTank's Avatar
    Join Date
    May 2003
    Location
    Houston, TX
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This may seem a little simple, but what is wrong with just using the server timestamp? Even with ebay you have to refresh the page for it to tell you how much time is left.

    You could write a function that flags true if you are before the end date and then will give you time remaining.
    I think sometimes I dream in code.

  5. #5
    Xbox why have you forsaken me? moospot's Avatar
    Join Date
    Feb 2001
    Location
    Clearwater, FL
    Posts
    3,614
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What i was thinking about the global.asa is it could check like every 20 minutes. Run a function to update the auctions. On the actual auction page, you will have to query the db to see if the auction is still open. But the behind the scenes stuff...sending out emails, etc...only needs to be done once.

  6. #6
    Original Gangster silver trophy SitePoint Award Recipient Thing's Avatar
    Join Date
    Oct 2000
    Location
    Jackson, NJ
    Posts
    4,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That would work moospot, the only issue is what if no one is on the website. Then the global.asa file will never get executed until someone goes to the website. I think I'm going to have to take that route anyway, because I can find no other way of doing this. Thanks!

  7. #7
    Xbox why have you forsaken me? moospot's Avatar
    Join Date
    Feb 2001
    Location
    Clearwater, FL
    Posts
    3,614
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could possibly set up some kind of countdown timer.

    http://www.google.com/search?sourcei...ountdown+timer

  8. #8
    Xbox why have you forsaken me? moospot's Avatar
    Join Date
    Feb 2001
    Location
    Clearwater, FL
    Posts
    3,614
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  9. #9
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to have a scheduled task periodically executing a WSH script (or calling an ASP page)... perhaps every 5 mins. But the pages could display the auction status instantaneously, since the DB will be queried each time they are displayed.

    Without a scheduled task, you will have to rely on the GLOBAL.ASA method, but as you've already pointed out, if you have no visitors, you're sunk!
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!

  10. #10
    SitePoint Enthusiast Soky's Avatar
    Join Date
    Sep 2003
    Location
    Southern Kentucky (SoKy)
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by M@rco
    You need to have a scheduled task periodically executing a WSH script (or calling an ASP page)... perhaps every 5 mins. But the pages could display the auction status instantaneously, since the DB will be queried each time they are displayed.

    Without a scheduled task, you will have to rely on the GLOBAL.ASA method, but as you've already pointed out, if you have no visitors, you're sunk!
    I saw a method someone used to schedule the task on their local machine to hit and fire the event on the production machine... it was slick solution however I cannot find my notes.

    Basically: there was a page on the production server that called the scheduled event... for example "sendmail.asp" with all the variables included. On his local machine he scheduled the page to be accessed automatically at 0100 and run the script with a batch file. This eliminates the need for visitors to file the global.asa scripts.

    I know... this is far from a solution but I hope it helps in some way.
    David Francis Web Application Developer
    Air Force trained web designer specializing in ASP/SQL
    online applications for business and organizations. Long term
    creation,hosting, marketing & website management partner.

  11. #11
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's certainly a possible approach but not one that I'd recommend - if that machine doesn't poll the script for any reason (e.g. it crashes, network issues, etc) then your auction site stops sending emails!
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!

  12. #12
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This kind of thing has been discussed many times before... here is one of the more recent threads on the topic:
    http://www.sitepointforums.com/showt...hreadid=121019

    Executing a query/SP periodically using the SQL Server Agent is one possibility raised.
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!

  13. #13
    SitePoint Enthusiast Soky's Avatar
    Join Date
    Sep 2003
    Location
    Southern Kentucky (SoKy)
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

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
  •