Ooh, yes. Well, I can do google, anyway. You should be able to figure out the rest.
PHP Code:
$st = $_SERVER['HTTP_REFERER'];
$host;
$keywords;
if(strpos($st, "google")) {
$host = "google";
$st = substr(strpos($st, "q="));
$st = substr(0, strpos($st, "&")) > 1 ? strpos($st, "&") : strlen($st);
$st = substr(0, substr($st, "&") > 1 ? strpos($st, "&") : strlen($st);
$st = preg_replace('/\+/g', " ", urldecode($substr));
$keywords = $st;
}
Making it work with other search engines is a simple matter of working out what their GET variables are called, and so on and so forth.
Note: this is a more-or-less direct port of the Javascript script I wrote in this thread.
Bookmarks