|
-
March 1st, 1999, 09:52 PM
#1
Help, "posting" from a program to a HTML form
I am familiar with "Get" query strings and passing them to an HTML form, but how can I "POST" to a html form from my application?
Any help would be greeeatly appreciated!!!
-
August 3rd, 1999, 12:26 PM
#2
Re: Help, "posting" from a program to a HTML form
Check out IP*Works at www.dev-soft.com.
IP*Works contains an http control that allows you to post.
-Alex
-
August 4th, 1999, 02:03 AM
#3
Re: Help, "posting" from a program to a HTML form
MS WebBrowser Control has a Navigate2 method that has a PostData parameter.
You can use it for posting data.
-
April 24th, 2000, 09:11 AM
#4
Re: Help, "posting" from a program to a HTML form
is this the inet.ocx or is there another control?
thanks!
-
April 24th, 2000, 10:20 AM
#5
Re: Help, "posting" from a program to a HTML form
You can use the Internet Transfer Control that comes with VB. To Use :
Place an Internet Transfer Control onto your form. and then paste teh below code in modifying the URL.
private Function URLEncode(byval strData as string) as string
Dim intX as Integer
Dim strChar as string
Dim strTemp as string
for intX = 1 to len(strData)
strChar = mid$(strData, intX, 1)
Select Case Asc(strChar)
Case 65 to 90, 97 to 122, 48 to 57 ' "A - Z", "a - z", "0 - 9"
strTemp = strTemp & strChar
Case 32 ' " "
strTemp = strTemp & "+"
Case else
strTemp = strTemp & "%" & Hex(Asc(strChar))
End Select
next intX
URLEncode = strTemp
End Function
'***********IN FORM LOAD*****************************
Dim strPost as string
Dim strTime as string
strPost = strPost & URLEncode("Var1") & "=" & URLEncode(Trim$("This is my first value"))
strPost = strPost & "&" 'variable seperator
strPost = strPost & URLEncode("Var2") & "=" & URLEncode(Trim$("This is my second value"))
Inet1.Execute Trim$("http://www.server.com/mysite/mypage.asp"), "POST", strPost, "Content-Type: application/x-www-form-urlencoded"
Do While Inet1.StillExecuting
'this is here to keep from happening the infinite loop
'if the inet control does not respond within one minute then
'stop listening for this post, now we listen to the StateChanged event
If strTime = "" then
strTime = time
else
If DateDiff("n", time, strTime) > 1 then Exit Do
End If
DoEvents 'allow the event to process the message
Loop
strTime = ""
Tim Cartwright 'Will write code for food.
Information Systems
Splitrock Services Inc.
Tim C.
//Will write code for food
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|