943,383 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 6919
  • PHP RSS
Dec 20th, 2004
0

how to make member expire after so many days with php script

Expand Post »
I already have have a members login script.... but i have to manually delete users.....what i reaaly need is to know how to make member expire after so many days with a php script. (free or very cheap) :cheesy:
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mvblhp is offline Offline
5 posts
since Dec 2004
Dec 21st, 2004
0

Re: how to make member expire after so many days with php script

How much PHP do you know? You could just calculate the time length between the last login and registration time (if they've never logged in yet), or between the last two logins. If it equals x amount of time, then delete'em. How complicated is your current script? I could probably help you more if you give me more info on how much you know and what kind of script you're working with.
Team Colleague
Reputation Points: 262
Solved Threads: 18
a.k.a inscissor
samaru is offline Offline
1,227 posts
since Feb 2002
Dec 21st, 2004
0

Re: how to make member expire after so many days with php script

Use cookies for your login script. Set it for an expiring time for each user. Or simply use seesions if your good with PHP. Run the sessions from a MySQL Databse too, thatll help you keep track for sure how long they stay logged in or not.
Reputation Points: 16
Solved Threads: 3
Junior Poster
mikeSQL is offline Offline
196 posts
since Dec 2004
Dec 21st, 2004
0

Re: how to make member expire after so many days with php script

I don't know much at all! I'm using a free script. (Jpmaster77's Login Script)
What I need is to auto delete users and passwords from Mysql database after
a certain number of days. I can't find a free script that will do that.
I read that I could write a php script that will do this.....(by using cron to execute
it), but I don't know much about cron either. :o
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mvblhp is offline Offline
5 posts
since Dec 2004
Dec 21st, 2004
0

Re: how to make member expire after so many days with php script

WEll, I hope my tutorial wll help you, by for now, its at my latest test site if you want to go look and read up on it, it might help you as far as Kill Cookies go or even sessions so that you wont have t odo it manually from the Database. http://www.mtechhosting.com/site/mod...iewItems&vid=1

No registration as I said already that this is my test site.
Reputation Points: 16
Solved Threads: 3
Junior Poster
mikeSQL is offline Offline
196 posts
since Dec 2004
Dec 21st, 2004
0

Re: how to make member expire after so many days with php script

Quote originally posted by mvblhp ...
I already have have a members login script.... but i have to manually delete users.....what i reaaly need is to know how to make member expire after so many days with a php script. (free or very cheap) :cheesy:
This really should not be too hard. Depending on how you have your login, what information you store there. Add a date/time stamp. Set some kind of variable somewhere else. When ever that user or someone else or have a seperate script for it...check the difference between when the user /account was created and now see if the time is bigger than the variable which states how long a user is valid...it doesn't get any cheaper than this...

aldo
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tautologies is offline Offline
9 posts
since Dec 2004
Dec 27th, 2004
0

Re: how to make member expire after so many days with php script

1 word. Sessions!!
Reputation Points: 16
Solved Threads: 3
Junior Poster
mikeSQL is offline Offline
196 posts
since Dec 2004
Dec 27th, 2004
1

Re: how to make member expire after so many days with php script

You could of course use sessions to maintain a users logged in period, but the deleting will need to be handled by a cron executed periodic script.
To do this you would simply need to add a tmie stamp to each users database entry stating when they last logged in.
The cron'd script would then run a database query regularly, (say daily or weekly or whatever you need) which would check each users timestamp, compare it to the current time, and if it exceeds your x amount of time, delete the database row (all users details).

Please read the following documentation for a thorough and clear tutorial on using crons http://www.webmasters-central.com/t/cron.shtml

Hope this helps
Reputation Points: 12
Solved Threads: 5
Junior Poster
ReDuX is offline Offline
127 posts
since Sep 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: PHP Forums Warning: New Strain Santy Worm Attacks
Next Thread in PHP Forum Timeline: Slashes before Double Quote marks





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC