|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Membership freezes....but how ?
Hello there,
I would firstly like to say that any answer would be welcome, and that I hope you help me abit in that. I am reading the PHP and MYSQL web development book of Luke Wellin and Laura Thomson. I want to create the mbership system that describes the book, everything works fine but I'd like to add something more. I want my member's account to get frozen in a month and then be able to activate them again....that could be a year or 2 weeks it doesn't matter. I just need to find a tutorial about it, because I am not like the super-pro in php and can't make it by my own. Any help would be appreciated ! Regards, Jim |
|
#2
|
|||
|
|||
|
Jim,
I have actually never come accross a article that shows you how to do this. However I'll give you a suggestion how to. Firstly in your members table, you will need to store the date they signed up (datejoined-timestamp) and a active field (active-enum) with the values 0 or 1 Then you need to create a cron job (linux) to run once a day Then you would run something like $days = 10;//if user is older then x days then the account will disable $time = time() - (60*60*24 * $days) mysql_query("select * from member_table where unix_timestamp(datejoined) <= '$time' and active = 1"); That query should return all members who are older then 10 days and currently active. |
|
#3
|
|||
|
|||
|
so I do it about the same way,...I store my enums are either Y or N
active=Y or active=N
__________________
-- Jason |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Membership freezes....but how ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|