Jump to content

Recommended Posts

I have an auction website, and after a certain period of time the auction automaticly closes. (Im using PHP probid). How does that work??? Is there a function embeded in some page(for example index.php) and everytime a user visits the page it excutes a code to check wheater auctions are still valid, if not,close the auction.??If it works like that, does that mean if no one ever visits index.php then the auction would never close???? Or does it work some other way?

 

Currently I have a programmer working for me however I am alittle worried about his abilities as he said he cannot seem to figure out how cron jobs work and is asking for access to "scheduled tasks" in Plesk...is that a resonible request or does he have no idea what he is doing??? Help apperiated, thank you.

Link to comment
https://forums.phpfreaks.com/topic/116548-how-does-cron-jobs-work/
Share on other sites

I would say this can be done by cron jobs..so the request from your developer can be valid. but instead of giving access you fetch the list of scheduled tasks and pass it on to him...

 

besides this..the method you suggested may also be implemented, dont have idea about probid...

The auction closes when it needs to, Im just wondering how that works.

 

My programmer is writing another script for me,which automaticly transfers payment from the buyer to the sellers account when the time period of 14 days is up. however the payments are not automaticly sending. He cannot seem to figure out how to solve this and is suggesting I give him access to scheduled tasks..However my argument is: "If a auction can automaticly close after a certain period without scheduled tasks, why cant you get the payment to automaticly transfer into a different account??, both systems use the same logic dont they????"

 

 

You have to think of the auction as not a real thing but a row in a table in a databaste (or multiple rows)

 

The ability to apply a status condition to the auction (such as opened/closed) is based on its DATETME values in the database.

 

Closed is nothing more than a textual representation for a saying (this DATETME is expired).

 

The closing of the auctions occurs purely on the visual basis of the user's ability to alter it nothing magically happens at the second it is over.

as already mentioned, there can be 2 ways to do it...

 

1) the one which you mentioned in first post.

2) scheduled tasks.

 

Tell your programmer to prepare the script and run it manually for testing, once it seems to work  well, then you can set the scheduled task..he does not need access.

 

scheduled task is a normal PHP script, which is fired at given time intervals, but for development and testing you can fire them manually at given intervals..no need of access to cron..

 

hope it is clear.

 

If this was my application then the closing of auctions would definatly be an event trigger. This could be a function in a common include file throughout the site that is run every time a page request is made. This would as other have said check a date time field in a database and set a flag value to indicate the auction is over. If you used a cron job (scheduled task) for this then auctions may not close at the correct time. Lets say you had a cron running every 5 minutes then an aution due to close in 1 minute may remain open for another 4.

 

The idea of using the same method to transfer monies in my opinion is not good at all. So I click on index.php and it triggers a cash transfer between you and the user - wooo bad! What if I close my browser as the script is running?

 

This should definately be a script run via a scheduled cron in a secure area of your webserver. Not in the web root for sure!

If your programmer is any good then he should set up the program to report on any errors that may occur with transactions so you can take action.

 

Hope this helps.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.