This guide shows you step by step how to redirect your visitors based on the search term they used in 7search
Part 1
Part 2
you can also use ###KEYWORD### to change the page title:
it took me longer to write this guide than it did to write the script...hopefully some of you will find this useful
Part 1
- 7search allows you to track incoming keywords with the special string ###KEYWORD###
- when adding your site, your URL would look like this: http://www.example.com?keyword=###KEYWORD###
- in your script, you would use the code $keyword=$_GET['keyword']; to capture the incoming search term
- now that you have the keyword, you can use it to send the user to the appropriate place...
Part 2
- Suppose you have 5 pages for the niche "apples"... Green Apples, Blue Apples, Brown Apples, Red Apples, and Weird Apples
- check which keyword the user clicked on, so you can send them to the correct place -
if(eregi("green", $keyword)){ header('Location: green.php');}
elseif(eregi("blue", $keyword)){ header('Location: blue.php');}
elseif(eregi("brown", $keyword)){ header('Location: brown.php');}
elseif(eregi("red", $keyword)){ header('Location: red.php');}
elseif(eregi("weird", $keyword)){ header('Location: weird.php');}
what does that script do? it checks if part of the keyword had the word "green" in it, assumes the person was looking for the page about green apples, and sends them to green.php
if the user searched for keyword "green blue" then it will always go for the word it finds first.. this is a flaw but it's not crucial
you can also use ###KEYWORD### to change the page title:
<html>
<head>
<title><?=$_GET['keyword']?></title>
....etc...
it took me longer to write this guide than it did to write the script...hopefully some of you will find this useful