Hi folks.
I'm trying to POST some form data to an application running on a server. This is what my code looks like:
The response I keep getting that it's unable to connect to the server. Now I want to run this server side, and I saw something interesting. When I used ethereal to view http traffic between the two servers, it seemed like the server that I wanted to post data to was communicating back to server I wanted to run the code serverside on port 80. In otherwords, it seemed to me that the communication was reversed.
Can someone help me understand what I'm doing wrong?
I'm trying to POST some form data to an application running on a server. This is what my code looks like:
Code:
<%
dim xmlhttp
dim cookie
url = "[URL unfurl="true"]http://localhost/lists/index.php?p=subscribe&id=3"[/URL]
PostStr = "email=erneal@hotmail.com&emailconfirm=erneal@hotmail.com&htmlemail=1&attribute2=Errol&attribute1=Neal&list%5B2%5D=signup&listname%5B2%5D=DFIQ&subscribe=Subscribe+to+the+Selected+Newsletters"
Set xmlhttp = server.CreateObject("MSXML2.ServerXMLHTTP.4.0")
' Indicate that page that will receive the request and the
' type of request being submitted
xmlhttp.Open "GET", url, False
xmlhttp.send
cookie = xmlhttp.getResponseHeader("Set-Cookie")
xmlhttp.Open "POST", url, false
xmlhttp.setRequestHeader "COOKIE", left(cookie,instr(1,cookie,";")-1)
xmlhttp.setRequestHeader "COOKIE", left(cookie,instr(1,cookie,";")-1)
xmlhttp.send (PostStr)
%>
The response I keep getting that it's unable to connect to the server. Now I want to run this server side, and I saw something interesting. When I used ethereal to view http traffic between the two servers, it seemed like the server that I wanted to post data to was communicating back to server I wanted to run the code serverside on port 80. In otherwords, it seemed to me that the communication was reversed.
Can someone help me understand what I'm doing wrong?