Hi. One way do it this would be to pass a variable $feeling_lucky to search_function.php and then after the following code:
PHP Code:
if ((is_array($final_result)) && (count($final_result) > 0)) {
arsort($final_result);
add something like the following:
PHP Code:
if ($feeling_lucky == true) {
// query database to get number one $lucky_site
header("Location: $lucky_site");
exit();
}