Pass Parameters to a Web Page
Hi,
Does any one know of how to pass a parameter to a web page in VB. i want to pass some info, i.e uname and password, current time etc to a php web page, the web page will also give back a response when the info has been passed. i need Vb to capture the info that has been returned..
Thanks
Re: Pass Parameters to a Web Page
What method are you using, Winsock control/class, Inet control, Webbrowser control... ?
To pass parameters to a php page usually you do this:
Code:
http://www.mysite.com/phppage.php?field1=something&field2=something
Re: Pass Parameters to a Web Page
I want to use inet...
Which is the most efficient to use, coz i am developing a bulk sms software that should be a ble to pass at least 100 text message per second to the web page script that will do the sending of the messages.
Re: Pass Parameters to a Web Page
I'm gonna be crude here and suspect you are using an Inet browser control...
To send data:
VB Code:
InetObject.Navigate "http://www.mysite.com/phppage.php?field1=" & something & "&field2=" & something2
On event Document_Complete you can do:
VB Code:
dim strHTML as string
if not InetObject.Document is nothing then
strHTML = InetObject.Document.Body.Innerhtml
end if
if strHTML <> "" then
' Do whatever you please with strHTML
end if
If you are not using Inet control.. well then this example might be completely useless :)
Re: Pass Parameters to a Web Page
Quote:
Originally Posted by Paradox
Which is the most efficient to use, coz i am developing a bulk sms software that should be a ble to pass at least 100 text message per second to the web page script that will do the sending of the messages.
3 questions:
- Can't you do the bulk sending from the server?
- Are all the messages the same?
- What is the purpose of this bulk messaging?
Re: Pass Parameters to a Web Page
Quote:
Originally Posted by Devion
I'm gonna be crude here and suspect you are using an Inet browser control...
To send data:
VB Code:
InetObject.Navigate "http://www.mysite.com/phppage.php?field1=" & something & "&field2=" & something2
On event Document_Complete you can do:
VB Code:
dim strHTML as string
if not InetObject.Document is nothing then
strHTML = InetObject.Document.Body.Innerhtml
end if
if strHTML <> "" then
' Do whatever you please with strHTML
end if
If you are not using Inet control.. well then this example might be completely useless :)
The last time I checked the Inet control doesnt have a navigate method, I firmly believe you meant the Webbrowser control... :)
Re: Pass Parameters to a Web Page
3 questions:
- Can't you do the bulk sending from the server?
A Client will use the application to do type the mesage that is to be sent from whatever location they are and on the application i'm developing.so they must have an internet connection, so sending from the server is ruled out.
- Are all the messages the same?
Yes all the messages are the same. used for sending personalized greetings to company clients.
- What is the purpose of this bulk messaging?
send alerts to a large group of people in a short time as compared to doing the same either from your phone or a Modem which is quite slow.
Re: Pass Parameters to a Web Page
I see. Do you have access to the server side code? I ask because there is probably a quicker way of sending the message than PHP parameters.
Also, if the messages are exactly the same, you only need to send them to the server once.
Re: Pass Parameters to a Web Page
Yes i wrote the php script? wanna view it?
Re: Pass Parameters to a Web Page
Not really. I don't know any PHP :D
Does it have to be php? Can't you use a sort of direct transfer? Then you could use the Winsock control. It would be quicker.
Re: Pass Parameters to a Web Page
Quote:
Originally Posted by dee-u
The last time I checked the Inet control doesnt have a navigate method, I firmly believe you meant the Webbrowser control... :)
My bad :)
Re: Pass Parameters to a Web Page
I have managed to pass the params, now only have to figure out how to multithread the application so that its able to send multiple messages.
Now my other question can VB create a Multi thread application.
and how can i get the response passed from a web page to my app?
Re: Pass Parameters to a Web Page
VB can do multithreads... It's just a little bit of a pain in the buttocks :)
Re: Pass Parameters to a Web Page
Does any one know how to read a parameter that has been passed from a web page. i am using the inet control?