PDA

Click to See Complete Forum and Search --> : Fill out Web Form


lol999
Jan 16th, 2000, 04:17 AM
How can I fill out a web form using vb??

my problem is that the form is POST so i cant pass argument by:

file.cgi?&name=lol&pw=pw

can anyone help?

------------------
webmaster@hackvp.com
http://www.hackvp.com
I may be dumb, but I am not stupid!

B4
Jan 16th, 2000, 05:51 AM
I believe your mistake is that you do not need the first ampersand. It should look like this:
file.cgi?name=lol&pw=pw

-B4

lol999
Jan 16th, 2000, 11:15 AM
What I was trying to get at was that I cant pass arguments that way, weather the correct syntax is used or not. This is because of the form i want to fill out uses POST instead of GET. Any ideas?

------------------
webmaster@hackvp.com
http://www.hackvp.com
I may be dumb, but I am not stupid!

HarryW
Jan 16th, 2000, 06:13 PM
You use the request object to obtain information passed using the post method. Instead of

Request.Querystring

You use

Request.Form

So if you have a textbox on a form with VALUE="TXTNAME" that you want to use the value from, you would use:

strName = Request.Form("TXTNAME")

One important thing to note is that the form elements you are requesting are within the same form as you are requesting from - I've often had problems of this type, and needed to rearrange the tags.

If you need any more info, I have an ASP book next to me :)

lol999
Jan 17th, 2000, 05:17 AM
I kind of get it. Maybe a small example on how to fill out:
http://www.theglobe.com/registration/default.taf would be nice! Thanks

------------------
webmaster@hackvp.com
http://www.hackvp.com
I may be dumb, but I am not stupid!

HarryW
Jan 18th, 2000, 12:00 AM
Oh, sorry, no - the variables are passed in the HTTP request body, not the header. That's why they come after the blank line.

[This message has been edited by HarryW (edited 01-18-2000).]

HarryW
Jan 18th, 2000, 11:53 AM
Ok, that's quite a complex form, but the theory is simple. You said you understood the GET method but not the POST method - there really isn't much difference. The difference is that the variables you pass between pages are passed in the HTTP header instead of being added to the end of the address. However, to you it doesn't matter particularly where the variable is passed, only how to get at it :)

OH I SEE! you want to actually fill the form out - you're not designing the page :D

Sorry, I just wasn't expecting it.

You need to pass, using your example, the following line in your HTTP request header. after the "Content-length: " line and a mandatory blank line, you need to send:

name=lol&pw=pw

Since I've only really spent time on ASP from the point of view of server-side scripting, I know how to retrieve this information, but I'm not sure how you would put it there.

Hmm, I'll have a good think about it, but meanwhile you might want to post a new thread asking how to edit the HTTP request header you send to the server.

I wish you luck; I'll keep trying to find the answer.

Harry

HarryW
Jan 18th, 2000, 05:51 PM
There is an article on HTTP headers here that might be useful
http://www.asptoday.com/articles/19990304.htm

HarryW
Jan 18th, 2000, 05:54 PM
Also here:
http://www.asptoday.com/articles/20000106.htm

HarryW
Jan 18th, 2000, 06:19 PM
It looks like that second URL's just about exactly what you need, but it involves an ActiveX component which you have to pay for, called ASPSock. I gather from the page that it's a and ActiveX server component which lets you make direct connections through Winsock to a web server, using your dial-up connection.

You might want to ask around on this furum for such a component, though. It's the kind of thing some people do around here, I think.