I'm developing a small auction site on a Red Hat 9 machine.

What options do I have for doing automatic batch closing of all the auctions that have expired?

Right now all I can think of is doing a 'Cron' job on the server every 15min. I know nothing about that, but i'm sure its not hard.

Are there any php solutions that would run automatically?

    depending on your data structure, you shouldn't even need a cronjob for this. i assume all the auction data is stored in a database and that the auction start and end times are fixed. if so then each time a bid is entered run a check comparing the auction end time in the db and the current time and if the current time is later then spit out an error. if the auction end based on some other criteria (like highest bid) then do the same thing with those fileds.

    the point here is that you really don't need a dedictaed boolean field flagging an auction as open or closed, just use another criteria that already exists in the data structure.

      there is a special case however:

      If an auction expires WITHOUT a bid, then the auction details are to be emailed to a 3rd party contractor. Its not going to be a high volume site so I can't depend on someone frequently clicking on the auction, or anywhere on the site for that matter. Right now it will only be displayed on intranet to about 300-400 employees..later on it may be viewed via internet.

      Therefor, if an auction expires and nobody loaded that auction page, then it may not be updated and emailed to a contractor for some time..which is bad because they are bidding on job shifts at a hospital.

      All open auctions need to be checked regularly regardless of traffic.

        alright then, run a cron every hour or whatever. read up on the cron syntax. configure the cronjob to run a script that queries the database for auctions that have expired without a bid and mails the info to whomever. you could optionally have a field in the db that indicates whether or not the email was sent (if you don't want multiple emails sent about the same auctions).

          Write a Reply...