?
Solved

Vb code not finding function

Posted on 2013-01-17
2
Medium Priority
?
359 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
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…
Suggested Courses

650 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