I'm trying to figure out how to capture the search terms entered by users in the standard--and advanced--drupal search mechanism.

Why? I'm trying to create a module that will return ads based on the user's search keyword choices, like Google does.

I've made modules before, but I'm not sure where or how to capture those terms once the user clicks the search button.

Any help would be greatly appreciated.

Thanks
--Steve

Comments

ericatkins’s picture

Sounds like you could start by looking at the Zeitgeist module: http://drupal.org/node/50188

This is a module implementing history functions for search.

It enables a configurable "recent searches" block, and future versions can use its data to provide frequency reporting on searches over various time periods.

It has been developed as an answer to issue http://drupal.org/node/39267 for which the initially suggested solutions weren't seen as generally good.