Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XMLHTTP with POST method doesn't work

Status
Not open for further replies.

denoxis

Programmer
Jul 22, 2002
154
US
Hi,

I have been working on a website that utilizes this XMLHTTP object a lot. Examples look pretty easy, except the one with "POST" method. "GET" works fine, but the following example doesn't work:

xml.Open "POST", " False
xml.Send "param1=value1&param2=value2"
Response.Write xml.responseText

Second line doesn't post the values to the address. To make sure I put request.form("param1") and request.form("param2") to that address, but they were all empty.

Any ideas?
 
Could you put some TGML code tags around that?

I see a semi-colon where there shouldn't be one, but can't tell if that is in your code or if it is the forum burping while it tries to render that address...

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
minilogo.gif alt=tiernok.com
The never-completed website
 
semi-colon shouldn't be there.
Also ¶ is actually the shift+7 (on the US keyboard)
What is TGML BTW?
 
[ code ]

[ /code ]

click the process TGML link below the post form to see the avail tags

____________________________________________________
Python????? The other programming language you never thought of!
thread333-584700

onpnt2.gif
 
Here we go:

Code:
action	= Request.Form("a")
sku	= Request.Form("p") 
qty	= Request.Form("q")
order_id= Request.Form("o")


str_params = "a="&action&"&p="&sku&"&q="&qty&"&o="&order_id

caid	= request.querystring("caid")
cuid	= request.querystring("cuid")
loid	= request.querystring("loid")

Dim objXMLHTTP, xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
  xml.Open "POST", "[URL unfurl="true"]http://www.xxxxxxxx.com/shopping_cart.asp?caid="&caid&"&cuid="&cuid&"&loid="&loid,[/URL] False

xml.Send str_params
Response.Write xml.responseText
Set xml = Nothing

I know there are some values in str_params, but for some reason it's not passed to the shopping_cart.asp. I tried to post to another URL bu tit didn't receive either, so it's not the shopping_cart.asp that has the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top