Http Post Suggestions?
From: bfiddes_onedev (wfiddes_at_onedeveloper.net)
Date: 07/06/04
- Next message: Thomas Gagne: "Re: OOP and memory management"
- Previous message: Nick Landsberg: "Re: OOP and memory management"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 6 Jul 2004 11:29:09 -0700
I am trying to login into a remote site and add products via POST
It does not to seem to work. Everthing on the remote site uses form
and the post method to login and administrate things. They do not
allow me to upload asp. So I am trying to create applications on my
local computer to do everything that I need to do and just post the
data to the remote server.
However I am having problems.
Here is the code, any suggestions?
' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
' GRAB EACH FORM ITEM & SAVE INTO A STRING
' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
dim item, strReq, value
strReq = ""
for each item in request.form
if not strReq = "" then strReq = strReq & "&"
value = request.form(item)
strReq = strReq & item & "=" & value
next
MC_Login
AddProduct(strReq)
' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
' LOGIN TO MC ADMIN PANEL
' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Sub MC_Login()
dim http
set http = Server.CreateObject("Msxml2.ServerXMLHTTP")
http.open "POST", "http://sitename", false
http.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"
http.send "txtusername=username&txtpassword=password&btnLogin=Login"
End Sub
' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
' POST THE FORM DATA
' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Sub AddProduct(strReq)
dim http
set http = Server.CreateObject("Msxml2.ServerXMLHTTP")
http.open "POST", "http://sitename?ACTION=SAVEADDNEWPRODUCT",false
http.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"
http.setRequestHeader "AUTH_USER", "username"
http.setRequestHeader "AUTH_PASSWORD", "password"
http.send strReq
End Sub
Thank You
Bill
- Next message: Thomas Gagne: "Re: OOP and memory management"
- Previous message: Nick Landsberg: "Re: OOP and memory management"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|