topical media & game development

talk show tell print

#mobile-ar-8-3.txt / txt



  // Prepare the search value which will be used in SQL statement.
  // Arguments:
  // searchbox ; the value of SEARCHBOX parameter in the GetPOI request.
  //
  // Returns:
  // searchbox_value ; If searchbox parameter has an empty string,
  // return a string which is a combination of numbers, letters
  // and white spaces. Otherwise, return the value of searchbox parameter.
  
  function GetSearchValue ( searchbox ) {
          // if searchbox exists, prepare search value.
          if ( isset(searchbox) ) {
                  // initiate searchbox value and set it to any string that consists of
                  // numbers, letters and spaces using regular expression.
                  searchbox_value = ‘[0-9a-zA-Z\s]*’;
  
                  // if searchbox is not an empty string, return the searchbox value.
                  if ( !empty(searchbox) )
                          searchbox_value = searchbox;
                          return searchbox_value;
                  } //if
                  else {
  
          // If searchbox does not exist, throw an exception.
          // throw new Exception(“searchbox parameter is not passed in GetPOI
          // request.”);
          }//else
  
  }// GetSearchValue


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.