Results 1 to 5 of 5

Thread: winsock instead of internet control

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Posts
    79

    Cool winsock instead of internet control

    how would i go about like connecting winsock to a web site to fill a form like i would in internet conrol like
    Code:
    webbrowser1.document.all"name".value ="new value"
    or even using insert..

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: winsock instead of internet control

    Moved from Database Development forum, as this is not related to databases

  3. #3
    Frenzied Member numtel's Avatar
    Join Date
    Apr 2000
    Location
    CA
    Posts
    1,163

    Re: winsock instead of internet control

    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.

  4. #4
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: winsock instead of internet control

    Just send the HTTP POST header. It's not hard. I don't remember off hand but it's something like:

    vb Code:
    1. Private Sub Winsock1_Connect()
    2. Dim strHTTP As String
    3.  
    4. strHTTP = "POST /page.php HTTP/1.1" & vbCrLf
    5. strHTTP = strHTTP & "Host: www.thesite.com" & vbCrLf
    6. strHTTP = strHTTP & "User-Agent: VB" & vbCrLf
    7. strHTTP = strHTTP & "Accept: *.*" & vbCrLf
    8. strHTTP = strHTTP & "Connection: Keep-Alive" & vbCrLf & vbCrLf
    9. strHTTP = strHTTP & "page.php?field1=value&field2=value&field3=value" & vbCrLf
    10.  
    11. Winsock1.SendData strHTTP
    12. 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.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Posts
    79

    Exclamation Re: winsock instead of internet control

    can someone like help me understand instr whenim using internet controller thx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width