Hi,
First time posting here so please be gentle!
I wish to check a variable for a number of words that are in a array.
Not sure if this is the best way to do it, but this is what i have.
I have my own counter system that counts every visitor, but some of these visits are from BOTS, spiders..
So i wish to have a method of searching the HTTP_USER_AGENT for certain words i put in a array.
What i am after is how i get the words in an array and how i then get the script to check the HTTP_USER_AGENT for a word in the array and if so it will not complete the script. (not add to the counter)
if none of the words are in the HTTP_USER_AGENT then it will add to the counter.
so something like?
<?
// do array
// check if HTTP_USER_AGENT contains a word from array
if () {
// increase counter if none of the words are in HTTP_USER_AGENT
include(increas e.php);
}
?>
its the bit between the if () that i have no idea about, any help would be great.
cheers in advance for your help.
Jason
First time posting here so please be gentle!
I wish to check a variable for a number of words that are in a array.
Not sure if this is the best way to do it, but this is what i have.
I have my own counter system that counts every visitor, but some of these visits are from BOTS, spiders..
So i wish to have a method of searching the HTTP_USER_AGENT for certain words i put in a array.
What i am after is how i get the words in an array and how i then get the script to check the HTTP_USER_AGENT for a word in the array and if so it will not complete the script. (not add to the counter)
if none of the words are in the HTTP_USER_AGENT then it will add to the counter.
so something like?
<?
// do array
// check if HTTP_USER_AGENT contains a word from array
if () {
// increase counter if none of the words are in HTTP_USER_AGENT
include(increas e.php);
}
?>
its the bit between the if () that i have no idea about, any help would be great.
cheers in advance for your help.
Jason
Comment