<?php

/*
** DGS Search
** $Id: cgi.php,v 1.6 2006/01/24 07:08:09 sella Exp $
** Copyright (c) 2000-2001 Digital Genesis Software, LLC. All Rights Reserved.
** Released under the GPL Version 2 License.
** http://www.digitalgenesis.com
*/

if (!function_exists('getFormData')) {
	function getFormData() {
		$requestType = getenv('REQUEST_METHOD');

		switch (strtolower($requestType)) {
			case 'get':
				$data = $_GET;
				break;
			case 'post':
				$data = $_POST;
				break;
			default:
				settype($data, 'array');
		}

		if (!$data && function_exists('getSpecificFormData'))
			$data = getSpecificFormData();

		return $data;
	}
}

/* DEL ME
if (!function_exists('getEnvVar')) {
	function getEnvVar($envVar) {
		global $config;
		global $HTTP_ENV_VARS;
		global $HTTP_SERVER_VARS;
	 
		if ($config['debug'] > 1) {
			printf("<BR>->Debug: getEnvVar() - getenv(\"%s\"): %s<BR>\n", $envVar, getenv($envVar));
			printf("->Debug: getEnvVar() - \$GLOBALS[\"%s\"]: %s<BR>\n", $envVar, $GLOBALS[$envVar]);
			printf("->Debug: getEnvVar() - \$HTTP_ENV_VAR[\"%s\"]: %s<BR>\n", $envVar, $HTTP_ENV_VARS[$envVar]);
			printf("->Debug: getEnvVar() - \$HTTP_SERVER_VAR[\"%s\"]: %s<BR>\n", $envVar, $HTTP_SERVER_VARS[$envVar]);
		}
	 
		$retVal = $GLOBALS[$envVar];
		if (strlen($retVal) < 1) {
			$retVal = getenv($envVar);
			if (strlen($retVal) < 1) {
				$retVal = $HTTP_ENV_VARS[$envVar];
				if (strlen($retVal) < 1) {
					$retVal = $HTTP_SERVER_VARS[$envVar];
				}
			}
		}
	 
		return $retVal;
	} 
}
*/

/*
** Local Variables:
** c-basic-offset: 3
** tab-width: 3
** End:
** vim:
** vim: noet ts=3 sw=3
*/

?>
