Hello, is it possible to log and track an IP address for time on a site and then limit the time they can stay to 1 hour? I am trying to prohibit people from staying on the site for more than 1 hour at a time and then eliminate this restriction after 24 hours. Any help would be appreciated. Thanks!
yes you create a member area and in member area count the time per IP exit-enter Run a cron every hour to allow access to accounts where 24 hours passed Regards Alex
Gross, using crons for this is overkill Best way to do it is to store the list of IPs into the database, as well as the time they first accessed the site. Do a SELECT <timecolumn> FROM <table> WHERE ip="'.$_SERVER['DOCUMENT_ROOT'].'" WHERE time>".(time()-60*60*24)." LIMIT 1" If that returns a result, they've been on the site in the last 24 hours, and you'll just want to check and see if the time it gives is less than time() minus one hour (60*60). If you want it so they can do it 1 hour per 24 hour window, that's the best way to do it, if you want it to be they have to wait 24 hours since the last time, on every page view have it set lasttime=time() type of system. Hope that helps.