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




How To Submit A Form From VB App To Some Webpage Like HTML POST Method


I'd really appreciate if anybody of you can tell me the way how can i send some data to a webpage from a VB application. Actually i dont want the user to see the data in the address bar of the web browser when program trigger the web browser.
Data Could be submitted just like POST method in HTML so that it should be hidden....

Great Programmers..... hhhhhhhelllllllpppp meeeeeee.... plzzzzzzzzz




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How Do I Submit A VB Form Via HTML Form Post Method
Ok I have some web and VB interaction going on I am able to pull Dynamic ASP page down to VB and parse out the information I need for drop down and stuff in forms, That is easy, but how do I have a form in visual basic submit the information to a web page. It needs to go back to a web page and then there will be a web page returned I am really stuck, I know how to do it requesting a page with a query string with the info in there but I do not want the query string being shown anywhere so I would really just like to submit the form via the html post method

Submit Using POST Method With Webbrowser
Hi,
I am trying to submit a form using the webbrowser control. However, it requires using the post method which I am not really familiar with. The html looks like this:
<FORM ACTION="JOBSRC_A.CFM?cfid=5286799&cftoken=14505647" METHOD="POST">
<INPUT TYPE="Hidden" NAME="START" VALUE="31">
<INPUT TYPE="Hidden" NAME="State_Val" VALUE="'All'">
<INPUT TYPE="Hidden" NAME="FullPartAll" VALUE="'All'">
<INPUT TYPE="Hidden" NAME="Depart_Val" VALUE="'All'">
<INPUT TYPE="Hidden" NAME="HistDate" VALUE="All">
<INPUT TYPE="Hidden" NAME="SearchCriteria" VALUE=''>
<INPUT TYPE="Submit" NAME="SubmitSQL" VALUE=" NEXT 30>> ">
<INPUT TYPE="Hidden" NAME="INTERNALEXTERNAL_VAL" VALUE="ALL">
<INPUT TYPE="Hidden" NAME="WORKHOURS_VAL" VALUE="'9999999999'">
<INPUT TYPE="Hidden" NAME="NoRows" VALUE="30">
</FORM>

Can someone please explain to me how I can submit this form and the values.

Submit Webpage Form?
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!

Is There Any Way To Post A Form With The Name Of The Submit Button?
instead of web.document.forms(0).submit, is there any way to click a submit button based on its name? for example, if a submit button had the name "Post", how would you click it?

Clicking Submit On An HTML Form
Ok, as the title reads, I am trying to have my program click a submit button on a form. I have everything else coded, except this. My Code is as follows:


Code:
Private Sub Form_Load()
wb1.Navigate2 "MY SITE {I have a URL here}"
End Sub

Private Sub wb1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim doc As Object
Set doc = wb1.Document
For x = 1 To doc.All.length - 1
If UCase(doc.All.Item(x).tagname) = "INPUT" Then
Select Case doc.All.Item(x).Name
Case "nick"
doc.All.Item(x).Value = "MyClientID"
Case "comments"
doc.All.Item(x).Value = "MyUserID"

End Select
End If
Next
doc.Forms("submit").submit
End Sub

The only problem I am having is with the doc.Forms("submit").submit on the end. The error is telling me:

Object variable or With Block variable not set

Any help on why it won't click the button?

Filling Up A Form In A Html-doc And Submit It
How can I fill up a form in a html-doc and submit it?

How Could I Programmatically Submit A HTML Form
Hello all,

I use "Microsoft HTML Object Library" to submit some form's data to a PHP page.

Here is a very simple HTML page:


Code:
<HEAD>
<TITLE>TEST</TITLE>
<META http-equiv=Content-Type content="text/html">
</HEAD>

<BODY>
<FORM id="Form1" name="Form1" action="http://biznesimoti.com/tmp.php" method="post">
<INPUT id="Text1" type="text" value="100">
<INPUT id="SubmitBtn" type="submit" value="Submit Query">
</FORM>
</BODY>


which I read from inside of my VB program which is here:


Code:
Option Explicit

Private oHTML                                   As New MSHTML.HTMLDocument
Private WithEvents oDoc                         As MSHTML.HTMLDocument
Private WithEvents oForm                        As MSHTML.HTMLFormElement

Private Sub BtnStart_Click()
   
    Set oDoc = oHTML.createDocumentFromUrl("C:Simple.html", vbNullString)
    Do While (oDoc.readyState = "loading" Or oDoc.readyState = "interactive")
        DoEvents
    Loop
   
    Set oForm = oDoc.getElementById("Form1")
    Call oDoc.getElementById("SubmitBtn").Click
   
    Do While (oDoc.readyState = "loading" Or oDoc.readyState = "interactive")
        DoEvents
    Loop
   
End Sub

Private Function oForm_onsubmit() As Boolean
    MsgBox oForm.Action
End Function



Data are not submitted, although onsubmit event is being fired ... wierd.

Could anyone help me with this?

Using A Form Post Method In Vb
hello friends
i have a vb form using which i need to address the php page
on some server...
now for that purpose i have used the querystring which works fine in some cases when the request Get Method is used butttttt

Problem

1.The page on the server has used the(((( Request Post Method )))))instead of Get ..... now here my query string fails me ...... i have included the ASP Type Library

like
Dim a as asptypelibrary.request

now there is a(( mehtod name form ))

a.form (var)
it needs a parameter like (var ) but i dont know how to use this in vb.....
problems every where

2. i have added a dhtml Project but coz never used it b4 same is the case there 2.......



3. Also if i can read the response generated by the server in VB ????



Do Help me friends/...

Is It Possible To Detect A HTML Form On A Remote Site, And Click The 'submit' Button?
Alright.

Lets say there is a form which would be called through VB, etc, etc, I have that part working fine.

What I essentially want, is when They user clicks submit on the VB Application, it will somehow locate the submit button, and click it.

I cannot use Exact X/Y Coordinates, because they change (Long story).

Is there any possible way to do this?

There are also two buttons, Reset and submit, so I would only need the Submit one, obviously.

Post An HTML Form With VB?
say i had a form with a webbrowser control on, and allowed the user to browse to a certain webpage that has a search facility, that posts a form to an ASP page. would it be possible to somehow post that HTML form by clicking a button on the VB form?

Post An Html Form To An ASP Page
I have to create an HTML form in VB and submit it to an ASP page. So this would include finding internet connection, and once it is found submitting this html file to the asp site...

anyone have any ideas on how i can

1) find active internet connection

2) post this data to the site

Inserting A Webpage Into A Form (A HTML Help File)
I am not sure how to put a HTML help file into my VB project. I know how to write the HTML but do not know from there how to insert it into the frmHelp in my program. Any help would be appreciated.

Sending File Via HTML POST Form
Hi all!
I have a small php script on my server, that saves the file, given in a object of a html form, that is <input type=file name=filename>.

Now I'd like to upload the file via a VB prog, and not via the HTML form.
So I tried to automatically change the value of "filename" and submit the form via the VB program, but changing the "type=file" object is not possible because of some security issues.

So I'd like to send the file directly to the "save-php-script" via vb.
But there's the problem. I know how to send text-strings via vb, but I don't know how this works with files (file-uploads).

I seached for it, but just found some topics like this one: http://www.xtremevbtalk.com/showthread.php?t=82035

So, can you give me some information on how to do this?

It would be great!

Foxx

[*Resolved*]How To Post A Html Form Values From VB?
I want to submit some data in the form of html form values to an ASP page from VB.
The form's method="post"
If method is "get" then I will use Internet transfer control and request that page url with values.
I dont know what to do for submitting a form with "post" method.
Help me.
Thanks in advance.
Saran.

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

Submit String To Webpage
I knwo theres a lot of crap out there regarding this most of it ASP

I,by example want to do this...


eg...say yahoo mail webpage is loaded..I want my form(which remebers username and password) to take the username and password and autosend it to the website so they dont have to enter it manually(they just have to click one bttn) I already tried brwser.set focus and the vbsendkey(looping through username) then tab key then sendkey again for the pwd but it dont work as the textbox itsself on yahoo dont receive the focus..
Any help is highly appreciated..i did this b4 a long time ago and cant remember how

Thanks much

POST Data In Html Form That Has Checkboxes And Radio Buttons
I can post data to textfields with no problems with this code:

Code:
postData = "Name=" & Text1.Text

cURL = "http://somehost.com/form.php"

'Inet1.Execute cURL, "POST", Data, "Content-Type: application/x-www-form-urlencoded"


How can i post data to a form that has radio buttons and Checkboxes?

How Would You Submit This Form In A Webbrowser? (image As Submit Button) *UNRESOLVED*
<td bgcolor="#dedcdf" colspan="5" align="right"><input type="image" src="images/btn_join_now.gif" width="73" height="18" alt="Join now" border="0" name="/com/m/saturn/mAccountFormHandler.create"><input type="hidden" name="_D:/com/m/saturn/mAccountFormHandler.create" value=" "></td>

thats the html code... how would i submit that?

How Can You Submit A Form In A Webbrowser Based Solely On Its Submit Button Name?
Lets say a form has a submit button, and its text is 'Post'

(<INPUT TYPE="submit" VALUE="Post"> )

how can you submit that button by using its value?

Anyone know?

Pressing Of The Submit Button In Webpage
I have done some searching and Beachcomber said ...

Using the IHTMLDocument object you can access all elements of the html document directly, set values of form objects, simulate the pressing of the submit button, add or delete nodes and objects to an existing html page (local copy only), etc...

I am looking to open explorer, go to a site, fill in fields in an HTML fomr and click submit. the fileds never change. I have it all handled except for hitting the submit button. Any ideas. I have tried tring to find HTML to hit submit but it always requires some user interaction.

Is There A Way To Make A Submit Button Go To A Webpage?
When a user clicks on a command button I want it to go to a certain webpage. Anyhelp?

Programatically Clicking Submit In A Web Browser Doesn't Load Next Webpage
Hi,

I load a webpage into my webbrowser and then programatically click the submit button on the page, which should load the next page. The problem is it doesn't unless I place a message box in the code. My code goes something like the following:

Code:
'Currently on webpage 1
input.click() 'the submit button to webpage 2

while axwebbrowser1.readystate <> readystate.complete do
application.DoEvents
end while

msgbox("Only works if this is in")

xxxxxx'Other code to go to other webpages 3, 4,& 5 using the webbrowser.navigate command DoEvents works for this and the webpages are shown


(The syntax may not be quite right on the above as I don't have my code to hand at the moment)

The "application.DoEvents" is never called (this is not because of the syntax btw) readystate is always equal to complete and when I check the URL out it is still on the first page (the submit button one). (There is no point just having the "application.DoEvents" on its own either cos VB doesn't think there are any events to do). VB only goes and loads webpage 2 if the msgbox is there otherwise it will do something like a page not found on webpage 2 and go on to load webpage 3, 4 and 5. Why is this and why doesn't DoEvents work when you are programatically clicking on a webpage, but does when you use the navigate method? Any ideas with what I can do to overcome this problem and have my webpage load and display when .click is called?

Cheers

Submit Method In VBScript
HI,
How do I use the submit method in VBScript. WHere does the data go when I call submit? How I can I manipulate it?

Thankx in advance...

Post To Webpage Via VB.
Hi,
Since my regular VB forum seems to be down, I thought I'd give this one a try.
I'm looking for a way to post data to a webpage via VB or, alternatively, pass the data in a url query string.

This is for a wireless messaging service. I need to pass the phone# of the wireless phone, the message, and a callback number. Below is a query string example of what need to be passed.


Code:
http://messaging.sprintpcs.com/sml/guestCompose.do?post=Send&
recipientsAsString=1235551212&mobileNumber=1235551212&
body=MultiLine+Test.%0D%0AThis+is+line+2.%0D%0AThis+is+line+3.%0D%0AAl.%0D%0A&
callback=3215559898


Any help will be greatly appreciated.
Thanks,

By the way this will be a formless program, i.e. no forms.
Al.

Comparing A Webpage (html) And A Local Html File
hello, for a little project i am doing, i am searching for a small programm or routine that does the following.

every X Minutes do a compare of an existing html page from internet with a local html file stored on my hd.

if the html on internet has changed, do an event.
if the html on the internet and on my local hd is the same, do nothign and continue comparing in X Minutes again


can anyone help me please?

i tried to search the forum and code it myself, but i am a newbee..

thanks for your 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.

HTML Inputbox And Submit Help
Hey everyone i need some advice on how to go about my problem. I am logging into my router to change my wireless password. I can log in and replace the password just fine using the Webbrowser1. However i get a error when the html page loads:

Code:
Microsoft internet Explorer:
WARNING: Selecting the incorrect region may result in a violcation of applicable law.
Do you agree to act in accordance with these settings?
Once i hit the OK button it preforms my updated password BUT it keeps loading the page over and over again and changing the password (since the router says "Updating settings" and it goes back to the same page.. which loops all my stuff again...

Code:
Private Sub Command1_Click()
WebBrowser1.Navigate "http://xxxx:xxxxxxxxx@192.168.0.1/WLG_wireless2.htm"
End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
With WebBrowser1.Document
.All("passphrase").Value = "blahblahblah"
.All("Apply").Click
End With
End Sub
Any help would be great!
David

BHO And IE HTML PAGE SUBMIT ISSUE
Hello!

below IE html page

HTML Code:
<html>
<form name="form2php" action="processor.php">
<input type="text" name="textboxic"><br>
<input type="submit" name="submitor">
</form>
</html>
below BHO activex dll


Code:
Private Sub moBrowser_BeforeNavigate2(ByVal pDisp As Object, _
URL As Variant, _
flags As Variant, _
TargetFrameName As Variant, _
PostData As Variant, _
Headers As Variant, _
Cancel As Boolean)


Dim doc
Set doc = moBrowser.document

Dim x As String
x = doc.Forms("form2php").textboxic.Value


If Val(x) > 1 Then
??????
' i want if button submit was clicked and if textbox has not got a good value
' then IE DOES NOT go to processor.php but instead goes back like
'history. back(-1) somehow when you click submit button then IE gets
'stubborn and goes forward to .php at all cost
' but does not want to go back one page. i tried moBrowser.goBack
'still it goes forward
' SO HOW TO MAKE MY BHO TO FORCE IE HTML PAGE TO GO BACK for one
' page AND STOP THERE INSTEAD OF GOING FORWARD?
end if

A Way To DISABLE A HTML Submit Button?
Is there a way to DISABLE a HTML Submit Button like in VB?

thanks

RE- Is It Possible To Submit User Data To VB APP Using HTML
Is is possible to submit user data to MS database, using webbrowser , vbscript or HTML within vb6 form?



Edited by - saran_133 on 6/30/2005 11:49:51 PM

Automatic Submit Image Button In HTML By Using VBA
Hi,

I am a newbie here. I have problem with my code below. It couldn't submit the image button on this form.

Set objIE = CreateObject("InternetExplorer.Application")
With .Document.forms("comments")
.all.Item("sendemail").submit
End With

Here is the form in HTML code.

<FORM name="comments" method="post">
<table width="60%" align="center"><tr><td align="right">
<input type="image" src="xxx_.gif" width="55" align="absmiddle" alt="Cancel" value="cancel" name="cancel" height="20" border="0" />
<input type="image" src="xxx_.gif" width="94" align="absmiddle" alt="Send E-mail" value="email" name="sendemail" height="20" border="0" />
</td>
</tr>
</table>

Can any experts please help me?

(dumb Luck Ha!)HTML Submit (This Has Been Asked A Thousand Times Before)
The strange thing is that none of these methods have worked!


VB Code:
Dim i As Integer    For i = 0 To wb.Document.Forms(0).length - 1        If wb.Document.Forms(0)(i).Type = "submit" Then            wb.Document.Forms(0)(i).Click        End If    Next i

^-- This one just idles forever


VB Code:
wb.Document.Item("Submit").Click

^-- This one reports "object does not support that method"


VB Code:
Dim submitButton As HTMLButtonElement    For Each Item In wb.Document.documentElement.All    If Item.TagName = "input" Then        If Item.Value = "Confirm Sale" Then            Set submitButton = Item            submitButton.Click            Item.Click            Exit For        End If    End If    Next Item

^-- This one just idles as well

So, I don't know what else to try! lol
Here is the HTML of the form:

[code]
<form method="POST" action="http://www.mysite.com/sell.php?mode=sell&id=6929416" ENCTYPE="application/x-www-form-urlencoded">Please enter your password and click Confirm Sale to continue<br>
Password:<input type="password" name="pass">
<input type="submit" value="Confirm Sale">
</form>
[code]

I have my VB filling out the password just fine, but the Submit button won't be pressed! I am soooooo confused!

Method POST
I have a web submission form which uses the method POST for sending the data to the web server. So far, I have implemented the case of method GET where the query string just attach to the URL but with the method POST I don’t know how to enhance the appropriate query string to the body of HTTP request.

For example, I have the below web Form html source code.

<form name="searchform" action="www.myplace.com" method="POST">
<select name="InputType" style="width: 150px;">
<option value="" selected>Any
<option value="button">Hard Button
<option value="screen">Touchscreen </select>
<input type="text" name="InputModel" size="16" value="">
</form>

If the method was the GET, then it will be easy to submit this web form to the server, because the only you have to do is this:
Webbrowser1.navigate htttp://www.myplace.com?InputeType=&InputeModel=

In the case of method POST how this could be done?

Thanks for reading.

Post Method In VB
I actually need to be able to post data to php pages through the post method. The reason is to post informations on a forum automatically. I think I should be using Microsoft Internet Transfer protocol and his execute method, however i don't know how to post all the variables(i.e. name, title, message, etc...). I can even provide you the source code with the html form that makes the posts normally.

Any tips or pointers would be great, thanks.

Can I Post Using This Method?
i'm using the code:
     Set objDocument = objMSHTML.createDocumentFromUrl(URL, vbNullString)

Can I post data from a form using this method, and if so, how?

Thanks,
Dave

Method POST
I have a web submission form which uses the method POST for sending the data to the web server. So far, I have implemented the case of method GET where the query string just attach to the URL but with the method POST I don’t know how to enhance the appropriate query string to the body of HTTP request.

For example, I have the below web Form html source code.

<form name="searchform" action="www.myplace.com" method="POST">
<select name="InputType" style="width: 150px;">
            <option value="" selected>Any
            <option value="button">Hard Button
            <option value="screen">Touchscreen </select>
<input type="text" name="InputModel" size="16" value="">
</form>

If the method was the GET, then it will be easy to submit this web form to the server, because the only you have to do is this:
Webbrowser1.navigate htttp://www.myplace.com?InputeType=&InputeModel=

In the case of method POST how this could be done?

Thanks for reading.

Method POST
This is not a VB question, but may be somebody knows a good place to ask CGI questions (maybe a good forum like this one) or an answer to my problem.
I created a perl script and an html file. the perl script is called when the user presses a button on the webpage. This works fine on my local web server, but not on-line. I've tried at more than one provider. I put the .pl file in xx/cgi-bin and the html file in xx/. When I press the button I was talking about, I get the message
"The requested method POST is not allowed for the URL xx/cgi-bin..

Why?

thanx, ds

Refreshing A POST Method With IE 6.0
I am develponing an automated version of I.E. 6.0 that does various things, one that has been giving me problems is refreshing a page that was the result of a posted form. I am using the Webbrowser Control's Refresh2 Method. The problem I am running into is that this is a completely unattended version of IE 6.0 and refreshing a post method bring up a Internet Explorer security dialog box that says "the page cannot be refreshed without resending the information....". I have given up on trying to eliminate this box, but does any one have any ideas of how to control the box with the program? I have tried the Silent() method with no luck. Any ideas would be greatly appreciated. Thanks!

Inet Post Method
When using the POST method,

Which way is the post data meant to be formatted?


something like this??

strPostData = "option=value&option1=value1&option2=value2"


or is it like this??


strPostData = "option=value option1=value1 option2=value2"


Any ideas?

Inet And POST Method
Hi all
got kind of a newbie Q here...

Im using the inet component to submit some info to a web page (typical login), and it seems as if i need to provide a form name
(<form name="something">).
can i send this info to the page using inet??

thanx

Inet Post Method
Hi everyone, I have searched this topic and found little to nothing usefull.

I am running on VB6 and I need to be able to send some strings using the Inet POST method.

If anyone can give me a rundown on how to use it that would be awsome, thanks.

How Do You Code A Method = Post In VB
I have to send data to another domain/url via the post method. If the url name is https://theirwebaddress.com and I need to send two text fields first and last name.

How would you code this in VB.net

Thanks

Http Post Method
Hi All,

 I need help on the Http Post Method. Does anyone have a Post method example? I know it might be really simple.
I want to create some thing like this: the user clicks on a command button and takes the data from a text box and sends the data from the text box to a server.

Thanks

Chung331

 "Don't Worry Be Happy"

Post Method With Frames
Hi all, (VB6 SP3 IE5 W2000Pro)
Here is little description, what do I need to do...
I want to send a POST request for frameset page, containing 2 frames (first
is the query, second is response for this query, when first is submitted)
I did some ways to do it...
1. Using Inet VB component... Cannot retrieve frames source code (I need it
to analyse the query details) (response - This page uses frames, but your
browser doesn't support them)
2. Using wininet.dll ..... the same request
3. Using WebBrowser object... probably easiest way to do it, but I am not
sure, if it is possible to use POST method on it.

Can someone help me please? I would be pleasured to receive a code example,
eighter to pass POST request on frame, eighter to pass retrieving frames
HTML code.

Thanx a lot in advance.

Regards Roman

Problem With POST Method
I have an HTML form which after clicking submit, which triggers the POST method using mailto: to get the input fields back to an email address.

My problem is that the data coming back is not consistent.

Most times the data comes back in the email text as:

Name=John
Address=Main Street
Age=25

But other times it will come back as


Name=3DJohn
Address=3DMain Street
Age=3D25

In other words, sometimes the HEX value of the = sign is added after the = as a confirmation that the = is in fact an equals sign.

I have seen transmissions where the = sign is used to signify that the line is continued below on the next line, hence the use of =3D to differentiate from 'continuation'.

Why do some transmissions contain the 3D and others don't ?

Thanks for any guidance here.

How To Send HTTP Post Data Such As That Created By A HTML FORM And Send The Data To A Server
Hello List,

I am looking for examples in how to send HTTP Post data to a server and
wonder if anybody will have an example I can refer to.

Best regards,

Bruno Romero

Refreshing A Page With Post Method
I am trying to refresh a pag that was obtained with a post method. This brings up a Window warning hat says "The page cannot be refreshed without resending the information....." Is there any way to disable or capture this event and automatically respond?

How To Send Data To Php Via Post Method From Vb6
Could any one show me how send 3 variables(textbox data,listview 4th coloumn item and another constant varible to a php script via post method frm within vb6 by clicking send button. My goal is to send these 3 varibles to php script so it writes them to mysql.Thanks

How To Send Data To Php Via Post Method From Vb6
Could any one show me how send 3 variables(textbox data,listview 4th coloumn item and another constant varible to a php script via post method from within vb6 by clicking send button. My goal is to send these 3 varibles to php script so it writes them to mysql.Thanks

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