Click to See Complete Forum and Search --> : Submit webpage form?
lol999
Jan 7th, 2000, 11:20 AM
How would I be abled to have vb fill out a web based form and click the submit button?
prefferebly in my program, not opening up IE. thanks!
------------------
webmaster@hackvp.com
http://www.hackvp.com
I may be dumb, but I am not stupid!
John
Jan 7th, 2000, 04:00 PM
Have a look at this article on VB Square. It may be of some use:
http://www.vbsquare.com/articles/cgi/
------------------
John Percival
Editor, VB-World.net
john@vb-world.net
lol999
Jan 8th, 2000, 12:59 AM
That was a pretty bad article. Didnt exactly give any code. here is some more info.
I need to be able to fill out this form:
http://www.theglobe.com/registration/default.taf
now, when i view the source the form actions is
http://www.theglobe.com/registration/default.taf?function=verify&ref=http%3A%2F%2Fwww%2Etheglobe%2Ecom%2F&cat=service&type=reg1
I tried sending a variable like:
http://www.theglobe.com/registration/default.taf?function=verify&ref=http%3A%2F%2Fwww%2Etheglobe%2Ecom2F&cat=service&type=reg1&username=lol999
that just seems to try and submit. how can I pass some variables to the script?
Am I having trouble because it is POST?
Please help :)
------------------
webmaster@hackvp.com
http://www.hackvp.com
I may be dumb, but I am not stupid!
Actually I thought is was a pretty good article and it did have code, but apparently not the code you were looking for. Try diving into the WinInet calls, you can use HttpSendRequest to do what you want. Here's the documentation link:
http://msdn.microsoft.com/workshop/networking/wininet/reference/functions/HttpSendRequest.asp
...just need to convert the api's to vb-readable declares.
lol999
Jan 8th, 2000, 01:28 PM
I was looking around and I heard that to fill out a POST form, that using winsock should work. Any ideas on how I could do that?
------------------
webmaster@hackvp.com
http://www.hackvp.com
I may be dumb, but I am not stupid!
John
Jan 8th, 2000, 05:35 PM
Try something like this. Each variable can be appended to the URL by joining it with the & symbol.
So, looking at the HTML from the page, you would want something like:
http://www.theglobe.com/registration/default.taf?function=verify&ref=http%3A%2F%2Fwww%2Etheglobe%2Ecom%2F&cat=service&type=reg1&action_thankyou=globe_default_thank_you&action_defau lt_thankyou=&
etc etc
&globeCentives=1
It will be a long URL, but it should work.
If this does not work, then you will have to look at the MS Internet Transfer Control. It allows POSTing to forms using the execute method.
------------------
John Percival
Editor, VB-World.net
john@vb-world.net
lol999
Jan 9th, 2000, 11:18 AM
No, it dows not work, if you read my earlier post it says that it will NOT allow me to do this. Do you have any examples of using the MS Internet Transfer Control execute command to do what I want?
It woud be appreciated. Thanks
------------------
webmaster@hackvp.com
http://www.hackvp.com
I may be dumb, but I am not stupid!
Webauctioneer
Apr 21st, 2001, 06:14 PM
Here's something that will submit your email address and name to the FreeVBCode newsletter using the Internet Transfer Control.....
Go look at the source to the form at:
www.freevbcode.com/newsletter.asp (http://www.freevbcode.com/newsletter.asp)
Private Sub Command1_Click()
Dim strURL as String, strFormData AsString
strURL = "http://www.freevbcode.com/newsletter.asp?"
strFormData = "Name=YourName&Email=YourEmail@isp.com&Available=Yes&SendSubscription=Submit"
Inet1.Execute strURL, "POST", strFromData
If you want to pop a browser into it to see what's going on after the data is submitted....add below
WebBrowser1.Navigate Inet1.URL
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.