XMLHTTP POST DATA HELP !

G

Graham Mattingley

Hello I had this idea that I thought was going to be really simple, and I
just cant get it to work..

I have use an affiliate link on my site, and I did not like it because it
did not have my sites banners on it, so I asked the permission of the other
site to change the display and they aggreed..

The affiliate site has 4 pages of forms linking to each other so it goes
something like
form.asp > results.asp > results_details.asp > confirm_details.asp >>>>>>
proceed to payment..

I wanted to grab the each page page using the XMLHTTP object and then the
post of the form to a local pages on my site.. The local pages would grab
the request.form string and then using code something like below..

on my page quote123.asp, I have <%=request.form%> and I never see the string
"select=All" - why is this...

Response.Buffer = True
Dim objXMLHTTP, xml
Set xml = CreateObject("Microsoft.XMLHTTP")

xml.Open "POST", "http://www.test.co.uk/insurance/quote123.asp", False
xml.Send "select=All"

Response.Write xml.responseText
Set xml = Nothing


I was going to post the request.form data to the real page on the remote
server and grab the results in XMLHTTP and work my way through the process
until I finally passed the browser_user to the payment screen.

I know this is possible as so many sites give examples of it, but I cant get
them to work on my server

any ideas ???


Graham
 
M

Martin Honnen

Graham said:
Hello I had this idea that I thought was going to be really simple, and I
just cant get it to work..

I have use an affiliate link on my site, and I did not like it because it
did not have my sites banners on it, so I asked the permission of the other
site to change the display and they aggreed..

The affiliate site has 4 pages of forms linking to each other so it goes
something like
form.asp > results.asp > results_details.asp > confirm_details.asp >>>>>>
proceed to payment..

I wanted to grab the each page page using the XMLHTTP object and then the
post of the form to a local pages on my site.. The local pages would grab
the request.form string and then using code something like below..

on my page quote123.asp, I have <%=request.form%> and I never see the string
"select=All" - why is this...

Response.Buffer = True
Dim objXMLHTTP, xml
Set xml = CreateObject("Microsoft.XMLHTTP")

xml.Open "POST", "http://www.test.co.uk/insurance/quote123.asp", False
xml.Send "select=All"

Response.Write xml.responseText
Set xml = Nothing


I was going to post the request.form data to the real page on the remote
server and grab the results in XMLHTTP and work my way through the process
until I finally passed the browser_user to the payment screen.

I know this is possible as so many sites give examples of it, but I cant get
them to work on my server

any ideas ???

XMLHTTP is supposed to sent text/xml, however you want to send
application/x-www-form-urlencoded thus you need to set a request header:
xml.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
Of course all this need to on one line with VBScript and needs to happen
before the Send call
 
G

Graham Mattingley

Hi Martin,

Thankyou very much for you assistance I am now able to see the varable on
the other page...
I think the big mistake I was making missing the <%@ Language=vbScript%>,
but none of the example I saw stated this in ther codes..

Thanks again

Graham
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top