1 Attachment(s)
Inet.Execute "Post" ??????????????????
Does anyone have an example of the Internet Transfer Control using the post method that WORKS?
Microsoft says Using the Execute Method with the Common Gateway Interface you would do like this:
strURL = "//www.yippee.com/cgi-bin/find.exe"
strFormData = "find=Hangzhou"
Inet1.Execute strURL, "POST", strFormData
But, they say that posting to an ASP form you have to add the header information....
"INFO: Header Required Posting HTML Form Encoded Data to ASP Page"
They say the format would be like this:
Private Sub Command2_Click()
Dim strURL As String, strFormData As String
'Change the server to your server name
strURL = "http://yourserver/scripts/testpost.asp"
strFormData = "lname=Doe&fname=John"
Inet1.Execute strURL, "Post", strFormData, _
"Content-Type: application/x-www-form-urlencoded"
End Sub
I have tried this and I can't get the dang thing to work.....
IF ANYONE HAS AN EXAMPLE LIKE THIS WORKING PLEASE HELP!!!!!
Here's a live example...if someone could help me get just this working, I can apply this to the site I am working on which requires a user name and password so I don't want to post that here....
but...here goes...you need a webbrowser on your form called WebBrowser1 and the Internet Transfer Control called Inet
Private Sub Command1_Click()
Dim strURL As String, strFormData As String
strURL = "http://www.ubid.com/app/search/search.asp"
strFormData = "trgt_siteid=1&scrtext=computer"
Inet.Execute strURL, "POST", strFormData, "Content-Type: application/x-www-form-urlencoded"
WebBrowser1.Navigate Inet.URL
End Sub
Here is the actual form in the ASP page this would be posting to:
<form action="/app/search/search.asp?trgt_siteid=1" id="FORM1" method="post" name="FORM1">
<td valign="top">
<input type="text" id="text1" name="scrtext" size="10" />
<input id="submit1" name="submit1" type="submit" value="Go" />
<br />
</td>
</form>
I have tried both setting strURL and strFormData both of the following ways:
strURL = "http://www.ubid.com/app/search/search.asp"
strFormData = "trgt_siteid=1&scrtext=computer"
and
strURL = "http://www.ubid.com/app/search/search.asp?trgt_siteid=1"
strFormData = "scrtext=computer"
I get the same results each time......
the search page comes back saying:
"Search Results for the Keyword - ""
Sorry, No results found for this search"
so, obviously my strFromData is not being included....
??????????
I just attached a small project if anyone wants to download it. It's like my example above but rather than hard coding a search on Ubids site for "computer" I entered a Text box on the form to be able to search for whatever word is put in the text box...But...it still doesn't work...can someone PLEASE tell me what I am doing wrong?