Jump to content

Archived

This topic is now archived and is closed to further replies.

dual_alliance

Background Running Code?

Recommended Posts

I was wondering if it is possible to have a PHP code that runs in the background.  Because l need a code that say at 00:00:00 server time it -1 from how many days the user is banned for.  Is this possible in PHP?

Thanks,

dual_alliance

Share this post


Link to post
Share on other sites
Your question doesn't quite make sense, but [i]maybe[/i] I have an idea of what you are trying to say.

Do you mean a code that will let them know they are still banned & for how many days, & will stay updated?  I designed an automatic member-management thing once, and I just put a simple code at the beginning of the home page, the admin index page, and the login page that ran through the members and changed a boolean flag for members whose expiration dates had passed -- so that you might actually block your own expired access just by trying to login.  Anyone who visited the site caused the updates to occur just by opening the page(s).  There is a name for this, "robot code" or "dummy code" or something, but I can't remember what it is -- but it works really well.  Would something like this work for updating number of banned days with your members?

If that isn't what you mean, can you elaborate?

Wendy

Share this post


Link to post
Share on other sites
Sorry for not being more specific, but you got what l am trying to achieve spot on.  Could u please tell me how to do this?

Share this post


Link to post
Share on other sites
Well running code in the background with php is impossible.  PHP is a server side language unlike javascript which is a client side language.  To do this in php you will need a mysql database or dat file, what you will need to do is setup a bantime field in your database and have php check it everytime the user logs on.  So in psuedocode:

if (allow >= daysbanned) {

// Allow user stuff here

}

Share this post


Link to post
Share on other sites

×

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.