Welcome Guest, Not a member yet? Register   Sign In
Detecting Bot using Codeigniter
#1

Is there any class or helper in CI for detecting and blocking bad bots? i have some pages that i don't want be visible by bot,
i know i can use robot.txt but some bots can read that,...
ressan.ir
CI is nice Heart
Reply
#2

I don't believe so. The only way really to detect would be the visitors (bot) IP and/or user agent string, both of which can easily be changed and are unreliable. If you have some pages that shouldn't be visible by someone (anyone), they should be behind a login, otherwise everything is considered public. What are you trying to prevent bots from seeing?
Reply
#3

in fact in my application any user get some point when one of him/his articles viewed by some one, so one user can get many point by using a bot,
ressan.ir
CI is nice Heart
Reply
#4

For bots which are behaving properly, you can use the user_agent library:
http://www.codeigniter.com/user_guide/li...::is_robot

$this->agent->is_robot() or $this->agent->is_robot('name_of_bot')

As already mentioned, though, when someone wants to create a bot which misbehaves, more than likely they're going to make it difficult for you to detect that bot, as well.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB