mdsh.com/wiki


RecentChanges

TextFormattingRules
AllWikiTopics
OrphanedWikiTopics
ToDoWikiTopics
WikiLockList
RSS
Export2HTML

WikiSearch

SetUsername

StartingPoints
Home
ColdFusion CGI variable test script

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Mark's Cold Fusion CGI variable test</title>
</head>
<body>
<table border="1">
 <tr>
  <th colspan="3"><br><h3>CGI Variables</h3></td>
 </tr>
<cftry>
 <cfset a = listToArray(listsort(StructKeyList(CGI),"text","asc"))>
 <cfloop index="i" from="1" to="#ArrayLen(a)#">
 <cfset variable.name  = "CGI." & a[i]>
 <cftry>
  <cfset variable.value = evaluate(variable.name)>
  <cfcatch>
	<cfset variable.value = "[cannot display]">
  </cfcatch>
 </cftry>
 <tr>
  <td valign="top"><cfoutput>#variable.name#</cfoutput></td>
  <td valign="top">=</td>
  <td valign="top">
 <cfif variable.name is "CGI.HTTP_COOKIE">
<cfoutput>#HTMLEditFormat(variable.value)#</cfoutput>
<hr>
  <cftry>
	<cfset variable.valueArray = ListToArray(variable.value,";")>
	<cfloop index="i" from="1" to="#arrayLen(variable.valueArray)#">
	 <cfset variable.valueArrayArray = ListToArray(variable.valueArray[i],"=")>
	 <cfset variable.cookieName = variable.valueArrayArray[1]>
	 <cfset variable.cookieValue = URLDecode("#variable.valueArrayArray[2]#")>
<cfoutput>#HTMLEditFormat(variable.cookieName)#=#HTMLEditFormat(variable.cookieValue)#</cfoutput><br>
	</cfloop>
	<cfcatch>[An error was caught]</cfcatch>
  </cftry>
 <cfelseif variable.name is "CGI.CF_TEMPLATE_PATH">
[not displayed]
 <cfelse>
<cfoutput>#HTMLEditFormat(variable.value)#</cfoutput>
 </cfif>
  </td>
 </tr>
</cfloop>
<cfcatch><tr><td>An error was caught</td></tr></cfcatch>
</cftry>
</table>
</body>
</html>

        


VeryQuickWiki Version 2.8.1 | Admin

All contents copyright mdsh.com (C) 2011-2023.