Hi,
I'm just learning to swim in PHP...
I need to detect a word in an URL of a referring search engine's page and based on the search term used display certain message. Here's a good example of a referring URL:
http://www.google.com/search?hl=en&q=textbook+buyback
Say I need to detect BUYBACK in that string. Here's what I've tried so far:
if(ereg("\buyback",$HTTP_REFERER))
{
Header ("Location: mymessage.php");
}
else {
Header ("Location: default.php");
}
Obviously it dosn't find what I need and sends a user to default.php.
Question: How to make this script look for a specific term withing en entire URL?
I'd apreciate any ideas.