Current location: Hot Scripts Forums » Programming Languages » ASP » Override request.form value


Override request.form value

Reply
  #1 (permalink)  
Old 12-07-06, 01:00 AM
loolweb loolweb is offline
New Member
 
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Override request.form value

I have this site with a lot of form pages in it.
Now I would like to clean the request.form values in order to avoid malicious code injections.

Since I don't want to go page by page and repeat writing the code to clean the values, I would like to do something generic for the site. So I have this module which is included in all my pages,
and there I want to go over the request.form values and clean them from illegal characters.

So the code looks like:

Code:
for each x in Request.Form
	Request.Form(x)=replace(Request.Form(x),">"," ")
next


which means that I want to replace the ">" character with " " (empty string).

The thing is that I cannot override the request.form value.
I'm getting this error:

Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'Request'


Does ASP prevents this override?

I know that with PHP you can override the $_POST values.

Can someone here suggest how to workaround it?

TX,
loolweb guy.
Reply With Quote
  #2 (permalink)  
Old 12-07-06, 10:53 AM
koncept
Guest
 
Posts: n/a
i have never tried to override the value, i typicaly work with variables so i will call the form item into var1 and then do my changes and return var1 from the function

so my code might be
Code:
<%
function striphtml(formi)
return 
replace(formi,">"," ")end function
%>


'in your for loop
striphtml(x)
i think that should do it. i have been coding in vb.net for a windows app for the last week so i might have mixed some of the syntax, if it doesnt work let me know.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 03:54 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.