Make Money With Affiliate Programs

earn money online affiliate program reviews and news

Archive for March, 2008


SE search string for your dynamic landing page

Lately I discovered a nice little but useful script to make a landing page even more dynamic. This script delivers the Google search string provided trough the HTTP_REFERER to a variable in order to put it on i.e. into the title or meta tags on your landing page. This can improve quality score or quality of user experience who are visiting your site, if done correctly.

<?php
// take the referer
$referer = strtolower($_SERVER[’HTTP_REFERER’]);
// see if it comes from google
if (strpos($referer,”google”)) {
// delete all before q=
$a = substr($referer, strpos($referer,”q=”));
// delete q=
$a = substr($a,2);
// delete all FROM the next & onwards
if (strpos($a,”&”)) {
$a = substr($a, 0,strpos($a,”&”));
}
// we have the results.
$googlekeywords = urldecode($a);
}
?>

and then put <?= $googlekeywords ?> whereever you want to integrate the keyword in your landing page.

I created a customized one for Yahoo just for you guys:

<?php
// take the referer
$referer = strtolower($_SERVER[’HTTP_REFERER’]);
// see if it comes from yahoo
if (strpos($referer,”yahoo”)) {
// delete all before p=
$a = substr($referer, strpos($referer,”p=”));
// delete p=
$a = substr($a,2);
// delete all FROM the next & onwards
if (strpos($a,”&”)) {
$a = substr($a, 0,strpos($a,”&”));
}
// we have the results.
$yahookeywords = urldecode($a);
}
?>

call it by placing <?= $yahookeywords ?>

and last but not least MSN:

<?php
// take the referer
$referer = strtolower($_SERVER[’HTTP_REFERER’]);
// see if it comes from MSN
if (strpos($referer,”msn”)) {
// delete all before q=
$a = substr($referer, strpos($referer,”q=”));
// delete q=
$a = substr($a,2);
// delete all FROM the next & onwards
if (strpos($a,”&”)) {
$a = substr($a, 0,strpos($a,”&”));
}
// we have the results.
$msnkeywords = urldecode($a);
}
?>

call with <?= $msnkeywords ?>

feel free to customize this stuff even more :-)