dual_alliance Posted September 24, 2006 Share Posted September 24, 2006 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 Quote Link to comment Share on other sites More sharing options...
WendyLady Posted September 24, 2006 Share Posted September 24, 2006 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 Quote Link to comment Share on other sites More sharing options...
dual_alliance Posted September 24, 2006 Author Share Posted September 24, 2006 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? Quote Link to comment Share on other sites More sharing options...
dual_alliance Posted September 24, 2006 Author Share Posted September 24, 2006 bump... Quote Link to comment Share on other sites More sharing options...
makeshift_theory Posted September 24, 2006 Share Posted September 24, 2006 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} Quote Link to comment Share on other sites More sharing options...
dual_alliance Posted September 25, 2006 Author Share Posted September 25, 2006 Thanks, but I get that l just don't no how to make it countdown and makes sure it only -1 per day. Quote Link to comment Share on other sites More sharing options...
dual_alliance Posted September 25, 2006 Author Share Posted September 25, 2006 anyone.... ??? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.