Http Post Suggestions?

From: bfiddes_onedev (wfiddes_at_onedeveloper.net)
Date: 07/06/04


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



Relevant Pages

  • Re: Web Import
    ... I tried to create a small procedure to load a web browser so I could login, ... Sub NextStep() ... .RefreshStyle = xlInsertDeleteCells ... .WebDisableDateRecognition = False ...
    (microsoft.public.excel.programming)
  • Re: Open child form from dialog form
    ... found out that login failed in sub main? ... except I can't close login dialog. ... > Dim LoginForm As New LoginForm ... > I've set the button's dialogresult property in the designer. ...
    (microsoft.public.dotnet.languages.vb)
  • Simple Login programming: Authentication does not work for me!
    ... I thought it should be a simple matter to put a login page together after watching LearnVisualNet videos! ... The Login1.Authenticate sub may not be necessary. ... Protected Sub Login1_LoggedIn(ByVal sender As Object, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Secure Multiple Applications in one Domain
    ... Original Page, Login Page, Post of Login Page, Original Page, ... Is using the element in my root web's web.config file the way to ... > another sub application located in the ... Regarding on the repeatly be redirect to login page. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Prevent passing of logon credentials
    ... Users at a remote site authenticate to their own DC. ... They also have a separate account with different login ... authenticating to my Exchange server when using Outlook. ...
    (microsoft.public.win2000.security)