Solved

change post array in asp

Posted on 2011-09-19
8
267 Views
Last Modified: 2012-05-12
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
Comment
Question by:nickgross19
8 Comments
 
LVL 13

Expert Comment

by:haloexpertsexchange
ID: 36562805
try
request.form(key) = "new value"

Open in new window

0
 

Author Comment

by:nickgross19
ID: 36563095
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
 
LVL 13

Expert Comment

by:haloexpertsexchange
ID: 36563177
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
 

Author Comment

by:nickgross19
ID: 36563698
So there is no way to do this in ASP then?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:godeschalk
ID: 36566074
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
 

Author Comment

by:nickgross19
ID: 36570662
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
 
LVL 28

Accepted Solution

by:
sybe earned 125 total points
ID: 36716274
> 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
 

Author Closing Comment

by:nickgross19
ID: 37020055
you cannot modify the post data so what i wanted to do was impossible.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Replacing smart quotes from word 7 67
ASP Sessions Being Cleared/Modified 6 65
Update field in order 21 122
Classic ASP - problem with MS SQL Select Query? 10 57
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now