# Use of InternetExplorer.navigate()



## Bob Henderson (May 26, 1999)

I'm trying to use IE5 from a VB6 project to HTTP POST some data to a web site.
Using MyBrowser.navigate(URL, Flags, TargetFrame, postData, Headers) to emulate an HTML form POST operation. The URL navigates OK but the postData isnt appearing to the server page. I'm sending a variant - byte array - with key/value pairs but I'm not reading it at the server end. Does anyone have a sample or a suggestion for sending the form data this way?
Sample: test.cfm cant see the postdata
Sub testbrowserpost()
Dim Ebrowser As SHDocVw.InternetExplorer
Dim URL As String
Dim Flags As Long
Dim TargetFrame As String
Dim postData
Dim Headers As String
Set Ebrowser = New SHDocVw.InternetExplorer
URL = "http://myserver.com/test.cfm"
Flags = 0
TargetFrame = ""
ReDim postData(1, 1)
postData(0, 0) = StrConv("mytestfield", vbFromUnicode)
postData(1, 0) = StrConv("mytestdata", vbFromUnicode)
postData(0, 1) = "myfield2"
postData(1, 1) = "mydata2"
Headers = "Content-Type: application/x-www-form-urlencoded" & _
vbCrLf
Ebrowser.Visible = True
Ebrowser.Navigate URL, Flags, TargetFrame, postData, Headers

End Sub

The MS web site only seems to have sample code for .NET

Thanks
Bob


----------

