Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

change post array in asp

I am trying to modify the information in the post array.  In PHP I could simply modify the post array by using $_POST[key] = "new value";

I do not know how to change the post array in classic ASP (it is not asp.net, just plain asp).  

Thanks for any help.
0
nickgross19
Asked:
nickgross19
1 Solution
 
haloexpertsexchangeCommented:
try
request.form(key) = "new value"

Open in new window

0
 
nickgross19Author Commented:
I tried it:

request.form("quality") = "new value"

Open in new window


but got this error

Object doesn't support this property or method: 'Form'
0
 
haloexpertsexchangeCommented:
I think you may not be able to easily update the request.form like you do with $_POST in php.
Request.form is a collection and probably would require a special method to update it, where as $_POST is basically just a glorified global array.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
nickgross19Author Commented:
So there is no way to do this in ASP then?
0
 
godeschalkCommented:
yes there is a way to this in asp.
put the array in a session variabele and on the next page put it in a var and than you can make changes in the array

session("arr") = arrSomething

on next page
dim arr
if isArray(session("arr")) then
  arr= session("srr")
end if
0
 
nickgross19Author Commented:
well, i'm using a big classic asp application that is quite large.  I need to go into the post data as soon as it is sent to the server to make sure that no malicious code has been put in the post data.  I do not know exactly how this large application utilizes the post data so i need to manipulate the post data.  

Setting a session variable won't work in this case.
0
 
sybeCommented:
> i need to manipulate the post data

Well, the post-data (as in Request.Form) is read-only. That makes sense, as it only registers what has been posted.

You can catch the posted data in your own variables
<%myvar = Request("fieldname")%>

and then of course you can change the value of myvar.

0
 
nickgross19Author Commented:
you cannot modify the post data so what i wanted to do was impossible.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now