filter bots

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
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

filter bots

Post by Vegan »

I am constantly working on new ideas for countermeasures against ad blocking
after scanning and searching I found a chunk of code that had some potential

Code: Select all

preg_match('/robot|spider|crawler|curl|^$/i', $_SERVER['HTTP_USER_AGENT']));
does leveraging the preg_match to spot Google etc, how can I use this to tell JavaScript that its a bot and beat up on it

many in script??

<script>

if <?php preg_match('/robot|spider|crawler|curl|^$/i', $_SERVER['HTTP_USER_AGENT'])); ?>

else

//run the rest of the security

</script>
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Post Reply