Results 1 to 10 of 10

Thread: Fill out Web Form

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 1999
    Posts
    39

    Post

    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?

    ------------------
    [email protected]
    http://www.hackvp.com
    I may be dumb, but I am not stupid!



  2. #2
    Junior Member
    Join Date
    Dec 1999
    Posts
    22

    Post

    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

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 1999
    Posts
    39

    Post

    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?

    ------------------
    [email protected]
    http://www.hackvp.com
    I may be dumb, but I am not stupid!



  4. #4
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827

    Post

    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

  5. #5

    Thread Starter
    Member
    Join Date
    Nov 1999
    Posts
    39

    Post

    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

    ------------------
    [email protected]
    http://www.hackvp.com
    I may be dumb, but I am not stupid!



  6. #6
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827

    Post

    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).]

  7. #7
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827

    Post

    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

    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

  8. #8
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827

    Post

    There is an article on HTTP headers here that might be useful
    http://www.asptoday.com/articles/19990304.htm

  9. #9
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827

  10. #10
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827

    Post

    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.

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