XMLHTTP POST DATA HELP !

Discussion in 'ASP General' started by Graham Mattingley, Nov 27, 2003.

  1. 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
    Graham Mattingley, Nov 27, 2003
    #1
    1. Advertising

  2. Graham Mattingley wrote:

    > 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
    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Nov 27, 2003
    #2
    1. Advertising

  3. 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

    "Martin Honnen" <> wrote in message
    news:%...
    >
    >
    > Graham Mattingley wrote:
    >
    > > 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
    > --
    >
    > Martin Honnen
    > http://JavaScript.FAQTs.com/
    >
    Graham Mattingley, Nov 27, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2hhaHJpYXI=?=

    xmlhttp post question

    =?Utf-8?B?U2hhaHJpYXI=?=, Jul 1, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    9,766
    Martin Honnen
    Jul 1, 2006
  2. Shannon
    Replies:
    7
    Views:
    303
    Bob Barrows
    Sep 29, 2003
  3. Jason Morehouse

    xmlhttp.open "GET" during browser post?

    Jason Morehouse, Jan 2, 2005, in forum: Javascript
    Replies:
    2
    Views:
    138
    Jason Morehouse
    Jan 2, 2005
  4. Sanjay  Dahiya
    Replies:
    4
    Views:
    288
    Sanjay Dahiya
    Apr 10, 2005
  5. yawnmoth

    Msxml*.XMLHTTP vs. Microsoft.XMLHTTP

    yawnmoth, Nov 7, 2006, in forum: Javascript
    Replies:
    11
    Views:
    370
    Matt Kruse
    Nov 9, 2006
Loading...

Share This Page