how would i go about like connecting winsock to a web site to fill a form like i would in internet conrol likeor even using insert..Code:webbrowser1.document.all"name".value ="new value"
Printable View
how would i go about like connecting winsock to a web site to fill a form like i would in internet conrol likeor even using insert..Code:webbrowser1.document.all"name".value ="new value"
Moved from Database Development forum, as this is not related to databases
If you are using winsock you would not even need to load the original page that contains the form. Just look up how the http protocol works and you can use GET or POST to send the form contents. It's going to be a lot more complicated than using the internet control and it won't be object oriented.
Just send the HTTP POST header. It's not hard. I don't remember off hand but it's something like:
vb Code:
Private Sub Winsock1_Connect() Dim strHTTP As String strHTTP = "POST /page.php HTTP/1.1" & vbCrLf strHTTP = strHTTP & "Host: www.thesite.com" & vbCrLf strHTTP = strHTTP & "User-Agent: VB" & vbCrLf strHTTP = strHTTP & "Accept: *.*" & vbCrLf strHTTP = strHTTP & "Connection: Keep-Alive" & vbCrLf & vbCrLf strHTTP = strHTTP & "page.php?field1=value&field2=value&field3=value" & vbCrLf Winsock1.SendData strHTTP End Sub
That's probably wrong but a simple search on the internet will show you the right way. Or download the free packet sniffer called Ethereal. Start it up, visit the website and submit the form. It will show you the correct data to send.
can someone like help me understand instr whenim using internet controller thx :)