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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm trying to automatically login t

Status
Not open for further replies.

mparter

Programmer
Apr 21, 2003
5
0
0
GB
I'm trying to automatically login to an external site using the following code:

Code:
Dim strPostInfo, strURL, objobjXMLHTTP
Dim strHTML

strPostInfo = "go=&key=&value=&Username=blah&Password=mark" 'construct the post data

strURL = "[URL unfurl="true"]http://www.url.co.uk/login.asp"[/URL] 'this is where were posting too
Set objXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP") 
objXMLHTTP.Open "POST", strURL, False

objXMLHTTP.Send strPostInfo
strHTML = objXMLHTTP.ResponseText 

Response.Write strHTML

All that happens is I am taken to the login screen. I think they may be detecting the referer which is why I'm not getting logged in automatically.

I've tried using setRequestHeader to change the host and the referer headers but this doesn't work. Is this possible?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top