public function referer( $valid_host = false, $valid_string = '' )
	{
		$ref = $this->server->getOr('HTTP_REFERER', '');
		if( $ref ) {

			if($valid_host) {
				$host = BASE_PROTOCOL . "://" . APP_HOST;
				$len = strlen($host);

				if( substr($ref, 0, $len) !== $host ) {
					return '';
				}

				if( strlen($ref) > $len ) {
					$end = $ref[$len];
					if( $end !== "/" && $end !== ":" ) {
						return '';
					}
				}
			}

			if($valid_string && strpos($ref, $valid_string) === false) {
				return '';
			}
		}

		return $ref;
	}