Jump to content


Photo

Background Running Code?


  • Please log in to reply
6 replies to this topic

#1 dual_alliance

dual_alliance
  • Members
  • PipPipPip
  • Advanced Member
  • 140 posts
  • LocationNSW, Australia

Posted 24 September 2006 - 09:16 PM

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

#2 WendyLady

WendyLady
  • Members
  • PipPipPip
  • Advanced Member
  • 38 posts

Posted 24 September 2006 - 10:14 PM

Your question doesn't quite make sense, but maybe 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

#3 dual_alliance

dual_alliance
  • Members
  • PipPipPip
  • Advanced Member
  • 140 posts
  • LocationNSW, Australia

Posted 24 September 2006 - 10:27 PM

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?

#4 dual_alliance

dual_alliance
  • Members
  • PipPipPip
  • Advanced Member
  • 140 posts
  • LocationNSW, Australia

Posted 24 September 2006 - 11:00 PM

bump...

#5 makeshift_theory

makeshift_theory
  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts

Posted 24 September 2006 - 11:56 PM

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

}
<b>Emacs</b> it's great for the body.
<br><br>
<b>Trust the TechnoLust</b>

<b><u>Have a question check here:</u></b>
PHP Manual: http://www.php.net

#6 dual_alliance

dual_alliance
  • Members
  • PipPipPip
  • Advanced Member
  • 140 posts
  • LocationNSW, Australia

Posted 25 September 2006 - 08:01 AM

Thanks, but I get that l just don't no how to make it countdown and makes sure it only -1 per day.

#7 dual_alliance

dual_alliance
  • Members
  • PipPipPip
  • Advanced Member
  • 140 posts
  • LocationNSW, Australia

Posted 25 September 2006 - 12:31 PM

anyone.... ???




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users