Help w/ ASP page?

C

Cliff

I've written a simple ASP page which forwards an incoming request to another
server. I'd like to add a variable to the request and have it appear in both
the POST and the GET when forwarding the request. Any ideas how to do this?

Here's the script:

<%@language=JScript%>
<%
var objSrvHTTP=Server.CreateObject("MSXML2.ServerXMLHTTP");
var url=http://anotherserver/

if (Request.ServerVariables("REQUEST_METHOD")=="POST") {
var DataToSend = Request.BinaryRead(Request.TotalBytes);
objSrvHTTP.open("POST",url,false);

objSrvHTTP.setRequestHeader("Content-type","application/x-www-form-urlencode
d");
objSrvHTTP.send(DataToSend);
// need to add another field here
} else {
// need to add another field here

objSrvHTTP.open("GET",url+"?"+Request.ServerVariables("QUERY_STRING"),false)
;
objSrvHTTP.send();
}
Response.Write(objSrvHTTP.responseText);
%>

Thanks!
Cliff.
 
U

UncleWobbly

haven't tried this but surely you can post it but put the argument after the
target URL?

so a post to

www.mysite.com?fred=45

so by putting the variable fred in the form and POSTing to the given URL,
fred would appear as

request.form("fred")

and

request.querystring("fred")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top