I'm a php noob. Is there a superglobal that tells which keywords the visitors that came from search engines are? Say a visitor searches for "apples" on google, how can i implement that keyword using php?
if (preg_match('~[&\?]q(?:uery)?=([^&]+)~', $_SERVER['HTTP_REFERER'], $keywords)) { echo $keywords[1]; } PHP: This should do it... it's untested though.