/* Buffer the output of the script until it is complete,
Then send entire page at once */
ob_start();
?>
/* Include adaptive techologies' custom MYSQL function library */
Include("/home/WWW/Units/library/aubrey/code/searchlib.php");
# THE FOLLOWING CODE IS FUNCTIONALLY REDUNDANT SINCE IT RELATES TO SWITCHING BETWEEN
# SIMPLE AND ADVANCED SEARCH FORMS, BUT SINCE WE LEFT THE ADVANCED SEARCH CODE IN
# THE SITE, CERTAIN PAGES RELY ON THIS CODE.
/* Retrieve which search form is shown from the URL parameters (simple/advanced) */
$shown = safe("shown", $_GET);
/* If there is a cookie present denoting the type of search (simple/advanced) last used
and there is no URL parameter specifying search type, use the type specified by the cookie */
if(array_key_exists("ADBIBSearchType", $_COOKIE) && $shown==""){
$parts=explode("#", $_COOKIE["ADBIBSearchType"]);
$shown = $parts[0];
}
/* If there was no cookie or URL parameter specifying which search form to display,
default to the simple search */
if($shown==""){
$shown= "simple";
}
/* Set a cookie specifying which search type the user is using */
setcookie("ADBIBSearchType", "$shown", time()+3600);
/* When a user changes search form, the page must be reloaded so the new form can
be displayed. Since the search forms are coded in the template, the code must determine
the current page at runtime, so it can link to itself.
This code retrieves the current page name */
$page = getenv("SCRIPT_NAME");
# END OF REDUNDANT CODE
?>
ADBiB
/* Finish buffering the script output, and send the page. */
ob_end_flush();
?>