I was just wondering how and if its possible
to submit a <form> programatically using VB
or a "stand-alone" VBScript.
Is there any way to create a "document"
object outside a web browser (HTML Document)?
Something like ...
Set form = CreateObject("Document.Form")
form.username.Value = "username"
form.password.Value = "password"
form.Method = "POST"
form.Action = "http://www.name.com/login"
form.Submit
Thanks in advance!
/Shaba
set http = createobject("msxml2.xmlhttp")
'
' pre-XML 3.0, use "msxml.xmlhttp" as the progid...
'
' if server side use:
'
'==> set http = createobject("msxml2.serverxmlhttp")
'
' which requires XML 3.0 or higher...
'
url = "http://localhost/test/enumform.asp"
foo = "this is foo"
bar = "this/is/bar"
sFormData = _
"foo=" & escape(foo) _
& "&bar=" & escape(bar)
http.open "POST",url,false
http.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
http.send sFormData
msgbox http.responseText
====enumform.asp====
<%
set f = request.form
for each v in f
response.write v & "=" & f.item(v) & "<br>" & vbcrlf
next
%>
--
Michael Harris
Microsoft.MVP.Scripting
--
mik...@mvps.org
Please do not email questions - post them to the newsgroup instead.
--
"Shaba" <shahryar_...@hotmail.com> wrote in message
news:138e01c146e0$484d5210$b1e62ecf@tkmsftngxa04...