envexlabs Posted October 17, 2007 Share Posted October 17, 2007 Hey, I've created a newsletter system where a user can send newsletters to member who have subscribed. To fight spam, the sender doesn't see the address that are subscribed. As another feature i want to make it so that the sender can only send 1 newsletter a day. I was thinking about just setting a cookie, but most people aren't stupid and could just delete the cookie. Is there a way to lock a cookie, or a better for of locking a user out for a set time? Thanks, envex Quote Link to comment https://forums.phpfreaks.com/topic/73681-locking-a-user-out-for-1-day/ Share on other sites More sharing options...
BlueSkyIS Posted October 17, 2007 Share Posted October 17, 2007 whenever a user sends a newsletter, set the user_id and the timestamp of when it was sent. don't let the same user send another newsletter until 86400 seconds after the last one the user sent. Quote Link to comment https://forums.phpfreaks.com/topic/73681-locking-a-user-out-for-1-day/#findComment-371721 Share on other sites More sharing options...
envexlabs Posted October 17, 2007 Author Share Posted October 17, 2007 Would this be done in a cookie? Quote Link to comment https://forums.phpfreaks.com/topic/73681-locking-a-user-out-for-1-day/#findComment-371724 Share on other sites More sharing options...
BlueSkyIS Posted October 17, 2007 Share Posted October 17, 2007 no, database. i assume you're tracking user logins via database. i would add fields onto that table or create a new table to track newsletter sends. Quote Link to comment https://forums.phpfreaks.com/topic/73681-locking-a-user-out-for-1-day/#findComment-371726 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.