I'm trying to automatically login to an external site using the following code:
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?
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?