j634 Posted July 11, 2009 Share Posted July 11, 2009 Hi everyone, On my current script I have a paid membership which has no time limit. They pay once and are members for life. I want to set up a three level system:1 month, 3 months and 6 months. The payment processor will only use PayPal. I have the basics understood, but think I need a little guidance to get me started. Does anyone have a link to a nice tutorial to help me do this? Thanks in advance for your help. Quote Link to comment https://forums.phpfreaks.com/topic/165596-solved-help-with-paid-membership-time-limit/ Share on other sites More sharing options...
ignace Posted July 11, 2009 Share Posted July 11, 2009 Add an extra column to your users table of type timestamp and upon registration: INSERT INTO users SET registration_date = NOW(), expiration_date = DATE_ADD(NOW(), INTERVAL 1 MONTH), ..registration data Then when a user logs in: <?php if (date('U', $row['expiration_date']) > time()) { // expired // expiration logic } ?> Quote Link to comment https://forums.phpfreaks.com/topic/165596-solved-help-with-paid-membership-time-limit/#findComment-873467 Share on other sites More sharing options...
kemo Posted July 11, 2009 Share Posted July 11, 2009 Well, if he use some cookie authentication, user may log in once a week, month, year.. so there will be better to check if subscription doesn't expired when user became active and then insert into users row timestamp when he was active..also check if activity is between some interval (for example check if he was active once a day, hour...) Quote Link to comment https://forums.phpfreaks.com/topic/165596-solved-help-with-paid-membership-time-limit/#findComment-873509 Share on other sites More sharing options...
j634 Posted July 16, 2009 Author Share Posted July 16, 2009 Thanks for the tips and apologize for taking so long to reply. I have just now set this up and hopefully all will work perfectly. Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/165596-solved-help-with-paid-membership-time-limit/#findComment-876156 Share on other sites More sharing options...
ignace Posted July 19, 2009 Share Posted July 19, 2009 Well, if he use some cookie authentication, user may log in once a week, month, year.. so there will be better to check if subscription doesn't expired when user became active and then insert into users row timestamp when he was active..also check if activity is between some interval (for example check if he was active once a day, hour...) Not exactly. By default a session cookie expires once the user closes his browser (unless the TTL of the cookie was modified using session_set_cookie_params()). Quote Link to comment https://forums.phpfreaks.com/topic/165596-solved-help-with-paid-membership-time-limit/#findComment-878231 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.