prevent bots from clicking links

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

prevent bots from clicking links

Post by jmut »

Hi,
I made this download counter....but I am afraid bots will click to links..trying to index stuff and this way they will falsly increase the counter.
How could I stop that?
I know there is robots.txt or something like that but ... :roll:
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Post by kaszu »

You can use javascript

Code: Select all

<script language="javascript">
function linkit($url)
{
  document.location=$url;
}
</script>
....
<a href="javascript: linkit('other_page.htm');">bla bla bla</a>
Most of the users have enabled javascript, but bots can't execute javascript (usualy).

Or for robot.txt, check http://www.robotstxt.org/wc/norobots.html
Post Reply