"You Searched for (blah)" PHP/ASP Code?

Status
Not open for further replies.

Avalanche

New member
Jun 27, 2006
737
5
0
The Marketingsherpa landing page guide showed some tests where adding the user's search term to the page had a nice little boost on conversion rates.

Does anyone have the code for adding something like

"You Searched for Blue Widgets" at the top of the page? I know how to do it for PPC, but how do you do it for organic traffic? Could I add the search engine, w/o much extra difficulty?

ASP code preferred, but I'll take the PHP version if anyone knows.
 


This isn't originally mind, I found it somewhere online and made some minor modifications. Unfortunately I can't find where I got from. Hope it helps.

PHP:
<?php
$ref = $_SERVER['HTTP_REFERER'];
$se = "";
if(eregi("msn",$ref))
{
$se = "msn";
$s=explode("?",$ref);
parse_str($s[1]);
$keyword = $q;
}
if(eregi("live",$ref))
{
$se = "live";
$s=explode("?",$ref);
parse_str($s[1]);
$keyword = $q;
}
if(eregi("google",$ref))
{
$se = "google";
$s=explode("?",$ref);
parse_str($s[1]);
$keyword = $q;
}
if(eregi("yahoo",$ref))
{
$se = "yahoo";
$s=explode("?",$ref);
parse_str($s[1]);
$keyword = $p;
}
if(eregi("altavista",$ref))
{
$s=explode("?",$ref);
parse_str($s[1]);
$se = "altavista";
$keyword = $q;
}
if(eregi("ask",$ref))
{
$se = "ask";
$s=explode("?",$ref);
parse_str($s[1]);
$keyword = $q;
}
$keyword = urldecode($keyword);

echo "You Searched for $keyword";


?>
 
The only annoying thing about stuff like this is any time an engine changes it's referrer info the code goes to hell.

lemme know how it works out.
 
Status
Not open for further replies.