Capture search term?
Typically searching with the default search box results in a url that looks like this:

/search/node/[search term]


So you can capture that search term (in your custom module presumably) with a line like this:

$path = explode('/', $_GET['q'], 3);

// Make sure the path you got has three components and begins with 'search'
if(count($path) == 3 &amp;&amp; $path[0]=="search") {
   // Get component #3 (index starts at 0)
   drupal_set_message("Here are my search terms: " . $path[2]);
}