Hi,
save it in the session variable in your header:
$_SESSION["mygooglekeyword"] = $mygooglekeyword;
Then assign it in theBefore display event on the Events tab:
$smarty->assign("search_searchfor","value=\"".htmlspecialchars(@$_SESSION["mygooglekeyword"])."\"");
Odly enough this method doesn't work out.
Using this method a delay is created. Like this..
Step (1) Search for a number in Google that brings you back to the web page.
No search will be returned in the search box as expected.
Step (2) Search the same number again in google.
On this second attempt it will return the result in the Search box.
However, thanks to your help I was able to get the result I need by using smarty to assign the keyword result directly to the Searcbox.
Like this.. : if($smarty) $smarty->assign("search_searchfor","value=\"".$mygooglekeyword."\"");
I had to use the "if($smarty)" because I use the header.php with HTML pages that do not load smarty.
Just in case anyone is interested in capturing google search keyword here is the actual code that I use in my header.php file
<?php
$thereferer = strtolower($_SERVER['HTTP_REFERER']);
if (strpos($thereferer,"google")) {
$a = substr($thereferer, strpos($thereferer,"q="));
$a = substr($a,2);
if (strpos($a,"&")) {
$a = substr($a, 0,strpos($a,"&"));
}
$mygooglekeyword = urldecode($a);
if ($smarty) $smarty->assign("search_searchfor","value=\"".$mygooglekeyword."\"");
}
?>