?
Solved

Vb code not finding function

Posted on 2013-01-17
2
Medium Priority
?
357 Views
Last Modified: 2013-01-17
I'm  not sure what function this code is attempting to use.  This is re-writing old code to work with current versions of .net  currently the function Request() is flagged as undeclared. I'm not sure the original intent of this function or where to find it.

Partial Public Class _loginlookup
 

    

function stripQuotes(strWords) 
	stripQuotes = replace(strWords, "'", "''") 
end function 

function killChars(strWords) 
	dim badChars(0 to 6) as string
	dim newChars as string
	dim i 


	badChars(0) = "select"
    badChars(1) = "drop"
    badChars(2) = ";"
    badChars(3) = "--"
    badChars(4) = "insert"
    badChars(5) = "delete"
    badChars(6) = "xp_"
	newChars = strWords 
	
	for i = 0 to uBound(badChars)
		newChars = replace(newChars, badChars(i), "")
	next 
	killChars = newChars 
end function 

function HTMLEncoder(strWords) as string
	
    HTMLEncoder = System.Web.HttpContext.Current.Server.HTMLEncode(strWords)
end function

'Used to secure request objects (Strings ONLY)
function allSecure(fieldName)
	allSecure = stripQuotes(killChars(HTMLEncoder(Request(fieldName))))
end function

'Used to secure variables
function allSecure2(fieldName)
	allSecure2 = stripQuotes(killChars(HTMLEncoder(fieldName)))
end function

end class

Open in new window

0
Comment
Question by:UnderSeven
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 2000 total points
ID: 38788439
It looks like accessing the Request query parameter i.e. the current Request.
Try

System.Web.HttpContext.Current.Request(fieldName)

Open in new window

0
 

Author Closing Comment

by:UnderSeven
ID: 38788462
Thank you!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month10 days, 16 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question