I need to limit the amount of pageview a user can have per minute to about 60.
How would I go about doing this? Of course I can make a mysql-solution, but I'm thinking there must be a way that takes less resources than that?
Thanks,
Terriator
Setting max. pageviews per minute
Moderator: General Moderators
Or cookies (less reliable). Either way you'd have to have a database/storage solution and a user login, or this couldn't really be effective.
[edit] Oh, per minute. Sessions should do the trick.
[edit] Oh, per minute. Sessions should do the trick.
Code: Select all
<?php
session_start();
if(!empty($_SESSION['pageviews']))
{
$_SESSION['pageviews'] = $_SESSION['pageviews']+1;
} else
{
$_SESSION['pageviews'] = 1;
}
?>Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.