Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Auto-store all request variables (See related posts)

// Puts all request variables into local variables. Never type request.querystring again. Easily modified to work with option explicit.

<%
	For each item in Request.querystring
		If not len(item) <= 0 Then
			Execute("[" & item & "] = Request(""" & item & """)")
		End If
	Next

	For each item in Request.form
		If not len(item) <= 0 Then
			Execute("[" & item & "] = Request(""" & item & """)")
		End If
	Next
%>

Comments on this post

Will_Rickards posts on Aug 04, 2006 at 11:29
You realize this is insecure?
In general you should avoid runtime evaluators like Execute.
Ever heard of sql injection attacks? Your code is subject to something similar.
The hacker would only have to create the right querystring to cause it to execute his code.
tonyenkiducx posts on Sep 05, 2006 at 09:45
This is obviously not for use in a public environment, as you quite rightly say.

You need to create an account or log in to post comments to this site.


Click here to browse all 5059 code snippets

Related Posts