kevin_it Posted September 1, 2006 Share Posted September 1, 2006 I am using php 5 and MySQL 4.0.18, and would like to accomplish the following on my page:I would like to only limit the user to only login every 2 weeks for a period of 4 days. So for example, they can login in Saturday, Sunday, Monday and Tuesday, but from that Wednesday to 2 weeks later they are not allowed to login, it should go to a countdown page saying you have xx days until you can login again.Confusing? I am a partial newbie, but am getting better at php. Let me know if there is anything else I can contribute to try and explain better.Thanks all.Kevin Quote Link to comment Share on other sites More sharing options...
redcore Posted September 14, 2006 Share Posted September 14, 2006 Couldn't you have a "last_login" field in your SQL table...then when someone tries to login, if the current date is 2 weeks from the day they last logged in then it sets a 4 day cookie and moves on but if not then it tells them how many days until they are permitted access? Quote Link to comment Share on other sites More sharing options...
Zane Posted September 14, 2006 Share Posted September 14, 2006 Well concept-wiseyou're either going to have set up a cron job to update everyone in your databases remaining usage time, every dayorhave it run a script to check that every time they log in....If you just have a small based thing I would go with the second optionjust add some code to your login script, where after they've successfully logged init runs a check to see if they have lapsed their limit yet or not... 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.