Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




[VB6] Winsock POST Request Problem


I'm trying to connecto to google.com and translate a simple word (just to test if works).

And I have a problem when I'm sending POST request data, here is my code:


Code:
Private Sub Command1_Click()
Winsock1.Close
Winsock1.Connect "www.google.com", "80"
End Sub


Private Sub Winsock1_Connect()
Dim packet As String
Dim strpost As String

strpost = "hl=it&ie=UTF8&text=hello&sl=en&sl=en&tl=it&tl=it"

packet = "POST /translate_t HTTP/1.1" & vbCrLf
packet = packet & "Host: www.google.com" & vbCrLf
packet = packet & "Accept: */*" & vbCrLf
packet = packet & "Accept-Language: it,it-it;q=0.8,en;q=0.5,en-us;q=0.3" & vbCrLf & vbCrLf

packet = packet & "Content-Type: " & "application/x-www-form-urlencoded" & vbCrLf
packet = packet & "Content-Length: " & Len(strpost) & vbCrLf
packet = packet & strpost

Winsock1.SendData packet

Text1.Text = Text1.Text & packet

End Sub


Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim data As String

Winsock1.GetData data
Text2.Text = Text2.Text & data & vbCrLf

End Sub



As you can see I want the GETDATA in Text2.Text but I recieve this error:


Code:
HTTP/1.1 411 Length Required
Date: Fri, 01 Aug 2008 13:57:24 GMT
Content-Type: text/html; charset=UTF-8
Server: GFE/1.3
Content-Length: 1357

{html code}


What's the problem?!

Thanks in advance.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Does Anyone Have An Example Of How To Send A POST Request With Winsock And A Proxy?
I know how GET works with winsock and a proxy, but how can you use a proxy and use POST?

anyone have an example?

HELP: Winsock To Send HTTP POST REQUEST To A Machine
Hello,

I would like to use visual basic to send data to a machine using an HTTP Post request, and cannot decide on the best way to do it. Can I use winsock. Please bear in mind the following.

I am sending a mult-part message (kind of like an email with attachments). It's actually a multimedia message in the MM7 format -> this is similar to email, a multipart MIME message.

I MUST post to a destination using the following format:

http://192.168.3.75:2097/mm7

I need to then send the data which I've formated according to the MM7 spec.

I need to receive responses from the receving application.

Any help would be greatly appreciated.

Thanks

Ben

How To Make A Post Request Using Vb6?
Hi all. I got a vb 6 form that has a a few text boxes that users fill their name and address and a text massage and a submit button. I wonder how i can make a post request on click of this button to a php page so it recives that data from vb6 form. I be happy if some one tell me how i can make such post
request.Thanks

How To Make Post Request To Php From My Vb6 App?
Hi all i wonder if i can make my vb6 application to talk to a php page and send the php page some mysql statment that it executes in remote server.I want to send an HTTP Request, like a POST, with some data for the PHP script to use.I be happy if i get some help here.Thanks

Post Request Webbrowser Control
Ok basicly I am working on a little project i call Google Office

I need to create a gui login and simulate a post request to the google login webpage...

and then navigate to the google docs main screen after login how would I do this?


wb.navigate2 URL,,PostData?

Help

Send Post Request To A Webpage
What's the "fastest" way to send a HTTP POST request to a webpage?


I know the winsock method. But I believe it is kinda slow.

How To Build An Http Post Request ?
Recently i have been working on a small app that extracts data from a google sevice.
But now google has started an api service that allows users to directly post data to google accounts.here's the link
http://code.google.com/apis/accounts...alledApps.html

Now i have never worked with get/post http requests.So could some one guide on how to build one and then work with the responses that have arrived

Thanks

Send Post Request To Default Browser
Hi,

I was wondering if it is possible to send a 'POST Request' To a users default browser?
If i would do something like

Code:
ShellExecute Me.hwnd, "open", "www.mywebside.com/login.php?username=root&password=pass", "", "", SW_SHOWNORMAL
Then it would just open the browser, and send a GET request...
But then the website wont work, because it grabs the POST requests...

I know it is possible with a winsock control, but i need it to get posted in the users brower...

how should i do this?

Thanks

Sending A POST Request From VB6.0 To Spring Controller
Hi All,
I need to POST a request which will actually call a spring controller (file upload )written in java.How do i do it?
Please help me.Response Will be Appreciated.
Thank you.

Automate To Send Post Request Thru IE Object
I have trying to send. But no luck. Can any one help

[Web Services] Server Receives GET Request Instead Of POST
I apologise for posting in this forum but I did not find another one more appropriate.

I am using SOAP SDK like in both client side and server side of a Web Service based application.

When I call the WS from a client machine (windows 2000/xp) the server receive a POST http request like expected but when I call the WS from anothers (windows nt 4.0) the clients sends a GET request and perhaps the server dont respond with the method invocation result (it responds describing the wsdl file). The client application is very simple and I do not understand where the difference arises.

In all machines (w2k prof/xp/nt acting like WS clients and w2k server acting like WS server) are installed the MS SOAP Toolkit 3

At the request sent by the NT machine also is missing the SOAPACtion header

Have any idea because the NT machines sends GET request instead of a POST one?

Thanks in advance

windows 2000/xp

POST /WSSAM/LPSamWS.WSDL HTTP/1.1..
SOAPAction: "http://tempuri.org/LPSamWS/action/LPSamWS.VencimientosPendientes"..
Content-Type: text/xml; charset="UTF-8"..
User-Agent: SOAP Toolkit 3.0..
Host: 172.16.0.29..
Content-Length: 1188..
Connection: Keep-Alive..
Cache-Control: no-cache..
Pragma: no-cache....
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope
xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAPSDK4:VencimientosPendientes xmlns:SOAPSDK4="http://tempuri.org/LPSamWS/message/">
<bstrMsgXMLIn>blahblahblah
</bstrMsgXMLIn>
</SOAPSDK4:VencimientosPendientes>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>.


windows nt

GET /WSSAM/LPSamWS.WSDL HTTP/1.1..
Host: 172.16.0.29..
Content-Length: 1188..
Connection: Keep-Alive..
Cache-Control: no-cache..
Pragma: no-cache....
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAPSDK4:VencimientosPendientes xmlns:SOAPSDK4="http://tempuri.org/LPSamWS/message/">
<bstrMsgXMLIn>blahblah
</bstrMsgXMLIn>
</SOAPSDK4:VencimientosPendientes>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>.

How Can Use Xmlhttp To Send A Post Request, And Have A Browser Opened With The Url De
I want to send a POST http request from VB to an HTTPServer. When the request is sent, I want a new browser to be opened with the url set to the same url as in the http request. How can I do that? the reason is that the url I want to send to need the user to authenticate first before processing the content in the request.

I'm using xmlhttp. the code I have below does get received by the http server. but I don't know how i can have the browser opened as a result of xmlhttp.

thanks in advance.

Private Sub posthttp_Click()
Dim xmlhttp As Variant
Set xmlhttp = CreateObject("MSXML2.XMLHTTP.3.0")
strUrl = <some url>
MsgBox strUrl
xmlhttp.Open "POST", strUrl, False

Dim xmldoc As Variant
Set xmldoc = CreateObject("MSXML2.DOMDocument")
xmldoc.loadXML ("<?xml version=""1.0""?><root/>")
xmlhttp.send xmldoc.XML
Set xmlhttp = Nothing
End Sub

Winsock Syntax? (To Request A Website With The Winsock Control)
Ok, I don't know very much about Winsock and am just now starting to use it. I'm making an anonymity program that modifies referer and user agent data. I managed to find an example of how its done on planetsourcecode.com but there's a few things that aren't working.

Anyway, when this string is sent, it sends the headers and a request for index.html from the connected host (winsock1.connect domain.com 80).

GET index.html HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-comet, */*
Accept-Language: en
Accept-Encoding: gzip , deflate
Cache-Control: no-cache
Proxy-Connection: Keep-Alive
User-Agent: Whatever
Referer: www.whatever.com

But when I used the website http://ipid.shat.net/ as the domain to see if code mdified the headers or not, it directed me instead to just www.shat.net. How would a browser request information to ipid.shat.net?

Also, I noticed that by sending just that information, cookies don't work properly. What other tags do I have to add onto that for it to recieve my session information? Thanks a lot.

Winsock Request
I have a Winsock component setup right now on my network, exact same as whats in this thread

I would like to know if a similar control can be built using Winsock to do this:


1) Connect to a remote computer, by IP address. (I have a code that determines the IP address of the remote machine already..)

2) Open a .txt file, send it back to (my) the users computer and displays it in a text box on screen.

3) On command button press, take what ever is in my text box, and send the file back to the remote computer and save it.

Kind of like editing a configuration file, remotly.

I know the application would have to be running on the remote end as well as my end for this to work, if its at all possible.

I would really like to do this, I appeciate everyones help in advance!

Winsock Example Request
I'm at work where I can't get to any help files for winsock.  Can somebody give me a quick example of the code required to create a winsock instance, including telling it to listen and respont to internet requests?  I'm going to attempt to make MS Access act like a simple server, and I just don't have the resources here to get it running.  Thanks!

Winsock HTTP Request Help
I need help with this, my wrapper uses winsock to send requests and the close event does not fire which makes the connection stay open forever, my wrapper is at the bottom it is a attachment

WinSock Request Accept
Hey,

I have been trying to get this code to work, It's most likely something stupid am doing, but i cant get my server program type thingie to accept the Request ID from the client program thingie... Here is the code to the part that it says is wrong (If you need anyother parts tell me an i'll post it)


Code:
Private Sub HostSocket_ConnectionRequest(ByVal requestID As Long)

'Show Request In Host Log
HMsg = "Connection request id " & requestID & " from " & HostSocket.RemoteHostIP
HostLog.AddItem (HMsg)

sRequestID = requestID
iSockets = iSockets + 1
ConNumber.Caption = iSockets
Load HostSocket(iSockets)
HostSocket.LocalPort = 1007
HostSocket.Accept requestID

End Sub
PS. I looked at an example to help me with this, so am not sure whats wrong.

Thx in advance.

Ali.

Can Winsock DLL Do Other Protocol Request ...
guys,

i find that the winsock OCX really is limited in its capability...
can anyone suggest me a better one for network programming? because the protocol type is limited to a few only....

I hope to do RTSP / RTP request ... is there any thing that i can used to do that ???

can Winsock Dll do other protocol request or its the total same with the winsock OCX?

Does anyone has a sample using winsock DLL (as client)...??

Winsock : GET Http Gives Me Bad Request , Why?
guys,

is the statement below wrong??

GET http://www.hypermart.com HTTP/1.0


the dataarrival shows me error message...

400 BAD Request

can anyone justify this please?

Multiple Request With Winsock
Greeting,

I have a little problem with winsock. I have a server and several
client. I want to transfer text from server to client trough the network
In this case, I using winsock to transfer the text. It is ok when only 2
computer connected (1 server and 1 client). But, when 3 computer
Connected (1 server and 2 client) I cant broadcast text to all client.

Does any body know how to broadcast text fom server to client trough the
network and winsock?

thanks

Rgds,
Rano Nugrah Agung Homan

Winsock Sample Request
Hi all,

I need to make a server app for my project. I have concluded that I will need to implement Winsock to do so. I have read up on all Winsock articles here (and many others elsewhere) and have downloaded and studied all the samples I could find.

However, I am unable to do what I want because:

- The tutorials say that the IP address or friendly name of the target computer MUST be specified for the Winsock control to connect on the other side. This strikes me as very backward, as I can not always know what IP addresses my customers' network stations will be running on and cannot also predict their friendly names. Does this have to be hard-coded?

- Try as I may, I cannot create a working sample of Server.Exe and Client.Exe to run on the same machine as I cannot afford the luxury of testing my code over two machines. Is there any way I can debug / test on one machine?

If any member proficient with Winsock (Laura Stephens and Jason Rogers come to mind) would like to help, I shall appreciate a small sample to get me started by solving the above two problems.

GoodGuy
Experience is a bad teacher for its exams precede its lessons.

Edited by - GoodGuy on 12/10/2007 10:23:30 PM

Winsock Array Connection Request
i made a post a couple days back gavino answered
im trying to make my multi chat program and well, it isnt goin by too well. for starters the client cant connect

Code:
Private Sub sckSocket_ConnectionRequest(Index As Integer, ByVal requestID As Long)
SockNum = SockNum + 1
Load sckSocket(SockNum)
sckSocket(SockNum).Listen
sckSocket(SockNum).Accept requestID
End Sub
is there sumthing wrong with that?

How Can You Request A Webpage Using Winsock And HTTPS?
HTTP is easy to form requests with using winsock..
but how can you make requests to a https site?

WinSock Connection Request Error!
When I use this code for a winsock connection request:

Code:
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Accept requestID
txtRecive.Text = txtRecive.Text & vbCrLf & "ChatX: Connection Request Detected."
End Sub


I get runtime error 40020:
Invalid operation at current state

when I hit debug it highlights that code snippet up there! HELP

Viewing Cookies Sent With Either Winsock Or INet Request?
Hello,

Is there a way that I can send a request via INET (Most Likely), and read the cookies which were sent with that request?

Thanks

Winsock Server Connection Request Problem
hey, this is my code


Code:
Private Sub wskServer_ConnectionRequest(ByVal requestID As Long)
Dim msgboxResult

msgboxResult = MsgBox("A connect request has been initiated by: " & wskServer.RemoteHostIP & vbNewLine & "Would you like to accept it?", vbYesNo, "Connection Request")

If msgboxResult = vbYes Then
wskServer.Accept requestID
isServer = True
End If
End Sub


now the problem is, whenever i run it, and have a client try to connect to it, this is the error the server gives me on this line "wskServer.Accept requestID"

---------------------------
Project1
---------------------------
Run-time error '40020':

Invalid operation at current state
---------------------------
OK
---------------------------

can someone help?


EDIT: and yes, i did try:
wskServer.Close
wskServer.Accept requestID

but it doesn't work. if u need 2 see my whole code to know whats going on, just let me know

Winsock/cookie Request Entity Too Large...
hi i'm sending a cookie header via winsock but i think it's to large cause I'm receiving a "Request Entity Too Large" in the HTTP Response. is there a way around this?

Winsock - Notification When User Accepts Request
Does anyone know of a way that an initiator of a Winsock connection can be notified when a user on the other end accepts the connection ? I'm new to Winsock, so my terminology might not be the best, but I'm trying to find out if the inititator has any way of knowing that a connection was made before any messages are exchanged?

Thanks for any help....

Winsock POST!
I have winsock control, and i'm trying to send two variable content to existing .asp file called prijava.asp.

Here is oroginal form


Code:
<FORM Name="frmWeb2SMS" Method="post" Action="Prijava.asp">
<p align="left">
<BR><font face="Verdana" size="2">Va<span lang="hr">š broj telefona</span>:
<span lang="hr">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>(067)</font><font face="Verdana"><INPUT Type="text" Name="txtTelNo" Value="" size="6" style="border: 1px dotted #FF7300; background-color: #CBD7E9" ></font><font size="2" face="Verdana">
<BR>Zadnjih 6 cifara sa SIM kartice: </font><font face="Verdana">
<INPUT Type="password" Name="txtSimNo" Value="" size="6" style="border: 1px dotted #FF7300; background-color: #CBD7E9" ></font><font size="2" face="Verdana">
<BR>
</font><font face="Verdana">
<INPUT Type="button" Name="cmdAuth" Value="Prijavi" style="border: 1px dotted #000064; background-color: #FF7300"></font><font size="2" face="Verdana">
</font><font face="Verdana">
<INPUT Type="button" Name="cmdReset" Value="Poništi" style="border: 1px dotted #000080; background-color: #FF7300"></font><font size="2" face="Verdana">
</font></p>
</FORM>
Here is my winsock control code:


Code:
Private Sub cmdsalji_Click()
mswinsck1.RemoteHost = "www.monet.cg.yu"
mswinsck1.RemotePort = 80
mswinsck1.Connect
End Sub

Private Sub mswinsck1_Connect()
httpRequest = "POST /Web2SMS/Prijava.asp HTTP/1.1" & vbCrLf
httpRequest = httpRequest & "Content-Length: 32" & vbCrLf
httpRequest = httpRequest & "Content-Type: application/x-www-form-urlencoded" & vbCrLf
httpRequest = httpRequest & vbCrLf
httpRequest = httpRequest & "txtTelNo=" & txttel.Text & "&" & "txtSimNo=" & txtcifre.Text & vbCrLf
httpRequest = httpRequest & vbCrLf
mswinsck1.SendData httpRequest
End Sub
And when i do cmdsalji_click, i get following error:

HTTP/1.0 400 Bad Request
Server Squid/2.4.STABLE4
...
The following error was encountered : Invalid Request
...

Where am i wrong??

Winsock POST
My problem is like this:
One of my webpage can generate a wav file using a string inputted by the user using POST method. The cgi program then generates a wav file for me. How can I write a VB6 application to finish this? Any sample code?
Thanks a lot... You can email me
Yours,
Cheryl

Winsock VB POST - No Response
I wrote a VB app to POST data to a PHP script i have on the web. Once the script recieves the data, it processes it and does some database stuff.

The VB app sends the data just fine, but i get no response from the server/script. My PHP script is set up to echo some data (and if you hit it via a web form instead of VB, you get a response.)

Under data arrival (winsock), i get a NULL response but it says there are like 300 bytes of data. What i mean by NULL is i tried to display strdata (winsock1.getdata strdata) in a a msgbox and textbox.. and nothing appears.


any suggestions?

Winsock Post Operation..
anyone got any idea how to do something like login to a webpage using winsock?
someone told me that you (somehow) send the username and pass to the page (both urlencoded), it will then return a cookie header and then you include the header in every request you make..

thanks for your time!

VB, Winsock API, HTTP Post
I'm making a program that sends post data to a server. it's been working great until I tried to use my post sub to submit/update a webpage. the problem is it's only sending part of the post data. here is my post code...

Code:
Private Function PostUrl(url As String, data As String, Optional Referer As String = "")
    On Error GoTo errHandler
    Dim tosend As String

    tosend = "POST " & GetDomainPath(url).Path & " HTTP/1.1" & vbCrLf
    tosend = tosend + "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*" & vbCrLf
    If Referer <> "" Then tosend = tosend + "Referer: " & Referer & vbCrLf
    tosend = tosend + "Content-Type: application/x-www-form-urlencoded" & vbCrLf
    tosend = tosend + "Host: " & WinSock1.LocalIP & vbCrLf
    tosend = tosend + "Content-Length: " & Len(data) & vbCrLf
    tosend = tosend + "Cookie: " & MakeCookieStr(url) & vbCrLf
    tosend = tosend + vbCrLf & data & vbCrLf
    Header = tosend

    txtSource = ""
    With WinSock1
        If .State <> sckClosed Then .CloseSocket
        .RemoteHost = GetDomainPath(url).Site
        .RemotePort = 80
        .Connect
    End With
    tmrTimeOut.Enabled = True
    PostUrl = PostTag(url, data, Referer, Action)
    Exit Function
errHandler:
    ErrorIn "frmWebPage.PostUrl(url,data,Referer)", Array(url, data, Referer)
End Function 'PostUrl(url As String, data As String, Optional Referer As String = "")



I looked at data var, it's compleat. so I know it's passing everything. for some reason though it's not "submiting" it all to the page. any ideas on why this may be? btw, I am useing winsock api, just got a class that acts alot like the winsock control. but doesn't need the ocx

Winsock HTTP Post
Basically i wanted to integrate Vonage (VOIP) Click 2 Call Features into My App

I have found the Html Code:

Code:<form action="https://secure.click2callu.com/tpcc/makecall" method="POST">
    username <input name="username"><br>
    password <input name="password" type="password"><br>
    fromnumber <input name="fromnumber"><br>
    tonumber <input name="tonumber"><br>
    <input type="submit">
</form>

How can i use this within VB rather than a Html File?

Thanks in advance!!

duttydea

Winsock With HTTP-POST
Hi,

I'm fairly new to VB6 and have started working on my second application.

I require the application to send a string to a PHP page on a website and have the PHP page handle the string sent.

I can establish the connection with winsock fine, but i'm unsure as to where to go next.

I've have a decent amount of knowledge with PHP, but just getting the data from VB6 to PHP is where i'm stuck.

After reading numerous posts and tutorials, everything seems to be pointing at using HTTP-POST, but none have succeeded in helping me to accomplish my goal.

If anyone could kick me in the right direction it would be greatly appreciated.

Winsock Header/POST Question
Winsock Header/POST Question

When u encode an upper level Char it becomes 3 chars
So when u send the header Content-Length is it proper to send the Decoded Char count or the Encoded char count? Both ways seem to work but which way is Proper?

How To Send POST Data With Winsock In VB
I am trying to send POST data with Microsoft Winsock control but keep on receiving garbage from the webserver. Can anyone tell me the reason please?

What I send:

POST /search HTTP/1.1
Host: www.google.com
Content-Length: 30
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Media Center PC 3.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Connection: close

hl=en&q=sql+tutorial&btnG=Google+Search

What I get:

HTTP/1.1 501 Not Implemented
Connection: close
Content-Type: text/html
Server: GWS/2.1
Transfer-Encoding: chunked
Content-Encoding: gzip
Date: Mon, 23 Oct 2006 17:08:55 GMT
Cache-Control: private, x-gzip-ok=""

Winsock HTTP POST - How Can You Send Files?
Like how can you send files that are sent by webbrowsers in the
<input type=file..> element?

anyone know?

Winsock HTTP POST - How Can You Send Files?
Like how can you send files that are sent by webbrowsers in the
<input type=file..> element?

anyone know?


i think its done by MIME, but how would you know what headers to use?

Loggin To A Website POST Method And DOM Or Inet Or Winsock HELP!!
Hi well what im trying to accomplish is succesfully load to a site that to login requires POST Method here's a little bit of the souce
-------------------------------------------------------------------------------
<form method="POST" action="membersarea.php">
<tr>
<td width="100%" colspan="2"><font color="#FFFFFF"><b><font size="1" face="Verdana">
EMAIL:</font></b><br>
<input type="text" size="17" name="email"></font></td>
</tr>
<tr>
<td width="100%" colspan="2"><font color="#FFFFFF"><b><font face="Verdana" size="1">
PASSWORD:</font></b><br>
<input type="password" size="17" name="password"></font></td>
</tr>
<tr>
<td width="100%" colspan="2">
<input type="checkbox" value="1" name="remember" CHECKED><font size="1"><b>Remember
Me</b></font>
</td>
</tr>
<tr>
<td><font size="1" face="Arial Narrow"><a href="lostpass.php">
Forgot Password?</a></font></td>
<td><input type="submit" value="Login" name="submit">
<input type="hidden" value="1" name="login_submit"></td>
</tr>
</form>
------------------------------------------------------------------------------

ok i need to login i have tried to do it with the DOM and this is what i got so far


VB Code:
Private Sub Command1_Click()With WB.Document.getElementById("email").Value = Text1.Text.getElementById("password").Value = Text2.Text.getElementById("remember").Value = "1".getElementById("submit").Value = "Login".getElementById("login_submit").Value = "1".Forms(0).Login.ClickEnd With End Sub Private Sub Form_Load()    WB.Navigate "http://www.domain.com"    Do While WB.ReadyState <> READYSTATE_COMPLETE        DoEvents    LoopEnd Sub


ok i get an error 'object doesnt support this method'
highlights this line

.Forms(0).Login.Click

anyway i can succesfully login to the page Thanks ALOT!!!

P.S. also there's anyway i can do it with INET control and winsock i would like to learn all of them 3 using POST method... thanks

regards,

EJ

Alternate HTTP POST Method Using XMLHTTP (Winsock/INET Control Problems)
I have a rather large application that we have been developing at work for about a year now that has a custom VB6 client and an ASP/VBScript server backend.

The application has been running pretty good on the INET control using the HTTP GET method for posting our queries to the server, but we have recently encountered the problem where some of our forms are larger then the 2k limit on HTTP GET. We have tried modifying the size of the allowed GET query/URL on the server (IIS6) but have been unable to get this to work either.

We then tried switching over to HTTP POST using INET and the StateChanged event. The problem is that the StateChanged event will never execute because the .Execute is located in a Module, but the INET Control and StateChanged event are located on our main Form. ARGH! Nothing we try seems to work with this method, and there are 100's of routines on aprox 20 forms that are calling our code in the Module when they need to query the server!

Yesterday I tried playing around with using the WinSock control - BUT IT SEEMS TO HAVE THE SAME PROBLEM! I am thinking there is a "bug" of sorts in VB6 that will not allow the StateChanged to fire if you utilize a control from another form or module that is not the original form the control is located on.

Today I am looking for a new method of implementing HTTP POST and retrieving the results that does not require the use of StateChanged. Any ideas?

Thanks for your time,
Dancing Hippo

Post Info To A URL Using Asp Script And Getting Results Like Http Method Post.
I am trying to find script or just where to start.
I want to use asp script (server side) to post some hidden info to another server(URL), then get the info back from the return page and parse through the text to return a page based on the text in the return page.
I Don't want to have the user forwarded to the page that the post is going to I just want to post info to the URL and get the data back. Then create a page based on the data.
Any help with this will be much appreciated.
Thanks,
Dave

Winsock &"POST&" Header Problems
I'm trying to "POST" to eBay's Loggin page with the following code:


Code:
Private Sub Form_Load()
Winsock1.Close
Winsock1.RemoteHost = "signin.ebay.com"
Winsock1.RemotePort = 80
Winsock1.Connect
End Sub

Private Sub Winsock1_Connect()

Dim strCommand As String
Dim strWebPage As String

strCommand = "POST /aw-cgi/eBayISAPI.dll HTTP/1.0" & vbCrLf
strCommand = strCommand & "Content-Length: 32" & vbCrLf
strCommand = strCommand & "Content-Type: application/x-www-form-urlencoded" & vbCrLf
strCommand = strCommand & "Accept: */*" & vbCrLf
strCommand = strCommand & "Accept: text/html" & vbCrLf
strCommand = strCommand & "Referer: signin.ebay.com/aw-cgi/eBayISAPI.dll" & vbCrLf
strCommand = strCommand & vbCrLf & "MfcISAPICommand=SignInWelcome&siteid=0&co_partnerId=2&UsingSSL=0&ru=&pp=&pal=&pa2=&pa3=&il=-1&pageType=559&userid=username&pass=passwrd&keepMeSignInOption=1" & vbCrLf & vbCrLf

Winsock1.SendData strCommand

End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
' get data and send to textbox
Dim webData As String
Winsock1.GetData webData, vbString
Text1.Text = webData
Winsock1.Close
End Sub

I get the following info in my Text box:

HTTP/1.1 302 Moved Temporarily
Server: Microsoft-IIS/4.0
Date: Wed, 24 Sep 2003 08:33:49 GMT
Content-Type: text/html
Set-Cookie: nonsession=AQAAAAIA... "Bunch of Code to long to list"
Location: http://signin.ebay.com/aw-cgi/eBayIS...L=0&bshowgif=0

I'm expecting to get the html page of "cookies not truned on", which I'm going to try to deal with later, but I get nothing.

Any ideas what may be wrong?
I was successful using Inet but since I'm dealing with cookies I figure I would try the Winsock route.

Any help would be greatly appreciated.

TIA,
Tony

Winsock Connection Prob: &"Request To Connection Time Out&".
Hi All,

I am developing chat application like Yahoo and MSN messenger. Also i have almost completed it. I have two applications one is server appliation which will be run on chat server machine. the other is client appliation which will be used at any corner of the world.

Its working fine on my network. Ya, it is also working fine over network but with some misbehaviour. Sometimesm, it allow someone to login and sometimes it doesn't and gives "Request to connection time out" error.. I can't find the reason y it is happening.

I have developed this in visual basic and used winsock control.

CANCELED THIS POST PLEASE SEE NEWER POST
SORRY



Edited by - compcad on 5/13/2004 10:34:40 AM

Request ID's
Can I use one Winsock control on one port and assign a different request id for multiple computers.

Get Request
Hi,

I have been reading this forum almost daily for months now and until now I have been able to find all of my answers through searches but today seems to be the exception - and maybe that is just because I am dense.

Anyway, I am trying to talk to a SitePlayer device via the internet. Right now my device is set up on a local network so its local IP is 10.0.0.12

Now the html command for what I want to do, if I were to do it from a web page is:

<form method="get" action="task02.spi?baud=65406">
<input type="text" name="com" MAXLENGTH="80" SIZE="80"></input>

This creates a text box and when the page is reloaded, whatever has been typed into the text box is sent out the serial port of the Siteplayer.

Ok, so far so good.

Question #1: How do I send that EXACT same command, text box and all, from visual basic (preferably using inet)?

Question #2: How do I send the "Get command" along with the string from the text box without referencing the text box in any way...so if I have a string strdata and I want to send that to the Siteplayer via the Get command, what is the VB equivalent of the above HTML?

I know the answer is simple but for some reason the get command is evading my understanding. Any help is greatly appreciated.

Thanks,

Alisha

IE Example (request)
I was woundering if anyone could show me 2 examples in vb6 - such a newb to it trying to get the feel of it lol :P

1. type in the text box an hit the command button and it brings up that url

2. enter the url in the txt box and it opens it on the form using the webbrowser control?

id really appreciate it if sumone could show me these

Thanks

DDE Request
I need to add a dde call to an app that has no form can I do it.
I only know how to do it using an object to link it to


my example:

Code:
label1.LinkTopic = "TagServer|Tags"
Label1.LinkItem = i & ",IsTagInError"
Label1.LinkMode = 2
Label1.LinkRequest
Label1.LinkMode = 0
That is how I know to do it

Copyright © 2005-08 www.BigResource.com, All rights reserved