Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Posting data to forms

105 views
Skip to first unread message

doesnotmatter

unread,
Aug 8, 2003, 4:30:28 AM8/8/03
to

Hi,
Id like to know if its possible to have an application fill an online form with data and post it as well. The form posts data via cgi. If so how ?
Thanks and regards

Lukas Gebauer

unread,
Aug 8, 2003, 4:45:39 AM8/8/03
to

When you try Synapse, then you can find demo sample for this in
disribution package. ;-)

--
Lukas Gebauer.
http://www.ararat.cz/synapse/ - Synapse Delphi and Kylix TCP/IP Lib.

Francois PIETTE

unread,
Aug 8, 2003, 4:50:28 AM8/8/03
to
> Id like to know if its possible to have an application fill an online form
> with data and post it as well. The form posts data via cgi. If so how ?

You can do it easily with ICS. Use the HTTP client component to do exactly
what a browser do when submitting a form (Post or Get method). If you need
help, please use ICS support mailing list where a team will answer your
questions and about 1000 subscribers wshare their experience with ICS.
Download ICS full source code from http://www.overbyte.be

--
Contribute to the SSL Effort. Visit
http://overbyte.delphicenter.com/eng/ssl.html
--
francoi...@overbyte.be
The author for the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be


doesnotmatter

unread,
Aug 8, 2003, 7:04:27 AM8/8/03
to

Hi Francois,

I already am using Indy 9. Is it not possible with Indy? If not then i'll try ICS.

Thanks and Regards

Bradley Cunningham

unread,
Aug 8, 2003, 12:44:03 PM8/8/03
to
> Hi Francois,
>
> I already am using Indy 9. Is it not possible with Indy? If not then i'll
try ICS.
>

I don't see why you couldn't do this with INDY.

Off the top of my head I would do something like the following:

First do a HTTP GET to retrieve the HTML form you want to fill in.

Then parse the HTML form and figure out what you need to fill in and fill it
in.

Then do a HTTP POST and submit the HTML form that you just parsed and filled
in to the appropriate place.


All of this can be done using the INDY HTTP client.


Remy Lebeau (TeamB)

unread,
Aug 8, 2003, 2:31:35 PM8/8/03
to

"doesnotmatter" <no...@here.yet> wrote in message
news:3f3383bb$1...@newsgroups.borland.com...

> I already am using Indy 9. Is it not possible with Indy?

Yes, of course it is possible with Indy. TIdHTTP has a Post() method which
can accept post data. Have a look at the TIdMultiPartFormDataStream class.


Gambit

doesnotmatter

unread,
Aug 8, 2003, 3:59:00 PM8/8/03
to

Hello,
Ok, the form has a few fields like "edit1", "edit2" ...etc and a submit button: "button1". The form is named "TrialForm" and the submit action is linked to a cgi script.
So using idHTTP how can i get along this ?

Remy Lebeau (TeamB)

unread,
Aug 8, 2003, 4:41:09 PM8/8/03
to

"doesnotmatter" <no...@here.yet> wrote in message
news:3f340104$1...@newsgroups.borland.com...

> Ok, the form has a few fields like "edit1", "edit2" ...etc
> and a submit button: "button1". The form is named
> "TrialForm" and the submit action is linked to a cgi script.
> So using idHTTP how can i get along this ?

Assuming the following HTML:

<form name="TrialForm" action="http://www.somesite.com/somescript.cgi"
method="post">
<input type="text" name="edit1">
<input type="text" name="edit2">
<input type="submit">
</form>

You would do the following with Indy:

var
PostData: TIdMultiPartFormDataStream;
Result: String;

PostData := TIdMultiPartFormDataStream.Create;
try
PostData.AddFormField("edit1", "TextFromEdit1");
PostData.AddFormField("edit2", "TextFromEdit2");
Result := IdHTTP.Post("http://www.somesite.com/somescript.cgi",
PostData);
finally
PostData.Free;
end;

Parsing out the values from the HTML is your own responsibility separately.
Indy has no facilities for handling that.


Gambit


doesnotmatter

unread,
Aug 9, 2003, 12:18:35 AM8/9/03
to

Thank you. Ill try this.
Regards

"Remy Lebeau \(TeamB\)" <gamb...@yahoo.com> wrote:
>

Clever Components Team

unread,
Aug 11, 2003, 2:09:25 PM8/11/03
to
Hello,

You are actually looking for components which can support POST method (and
preferably have Wizard which will help you to build POST params)

Try Clever Internet Suite Version 3.1
http://clevercomponents.com/products/inetsuite/suite.asp
http://clevercomponents.com/products/inetsuite/suitev3release.asp

Aplso please check our articles:
Simulate a Web Submit Wizard with POST Request
http://clevercomponents.com/articles/article014/websubmitwizard.asp
Simulate a Web Form POST Request
http://clevercomponents.com/articles/article009/httppost.asp

Try our Online Demos code available at:
Simulate Submit Wizard
http://clevercomponents.com/products/inetsuite/demos/submitwizard.asp
Simulate Web Form Post Request
http://clevercomponents.com/products/inetsuite/demos/formpost.asp
Simulate Web Submit (Upload) File
http://clevercomponents.com/products/inetsuite/demos/submitfile.asp

Best regards,
CleverComponents Team
www.CleverComponents.com

"doesnotmatter" <no...@here.yet> wrote in message

news:3f335fa4$1...@newsgroups.borland.com...

0 new messages