CFLib.org – Common Function Library Project

convertQueryStringToStruct(querystring)

Last updated December 27, 2013

author

Chris Weller

Version: 1 | Requires: CF8 | Library: DataManipulationLib

Description:
This function accepts a URL query string argument and returns it as a structure.

Return Values:
A struct of query string name/value pairs

Example:

<cfdump var="#convertQueryStringToStruct(querystring=cgi.query_string)#">

Parameters:

Name Description Required
querystring Query string to convert Yes

Full UDF Source:

<!---
 Converts a URL query string to a struct
 v1.0 by Chris Weller
 v1.1 by Adam Cameron (removing redundant intermediary variables)
 
 @param querystring 	 Query string to convert (Required)
 @return A struct of query string name/value pairs 
 @author Chris Weller (wellercs@gmail.com) 
 @version 1, December 27, 2013 
--->
<cffunction name="convertQueryStringToStruct" access="public" returntype="struct" output="false" hint="I accept a URL query string and return it as a structure.">
	<cfargument name="querystring" type="string" required="true" hint="I am the query string for which to parse.">

	<cfreturn createObject('java', 'coldfusion.util.HTMLTools').parseQueryString(arguments.querystring)>
</cffunction>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson