Reputation: 7417
Is there any "smart" way to block an IP if it accesses my project more than X times in Y time? I know the proposed way would be to block such cases from apache level but the client asks for extra precautions in application level.
Any suggestions? I was thinking for a MySQL table that holds one row per IP and a requests counter with time. But is there anything else?
Upvotes: 1
Views: 959
Reputation: 1976
$this->input->ip_address()
to take the user's ip address in the controller.$this->db->select_sum("counter")->get("views_table");
Upvotes: 1