Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate a web form from vfp

Status
Not open for further replies.

Eugen Fintina

Programmer
Apr 27, 2005
29
0
1
RO
I need to populate a web form from vfp. I know that it is possible but I'm not sure what is the best approach. I do not want to pass the data through URL because it's possible to have a lot of character and I'm afraid that I'll reach the limit.
 
Eugen,

It may be simple, or it can be really complicated.

Forms have an action which usually indicates the destination of your data.

Suppose you have a Web form with two fields, foo and bar, and an action pointing to "
You want to fill the form with the values "one" and "two".

So you may use something like this (quite simplified):

Code:
LOCAL HTTP AS MSXML2.ServerXMLHTTP60
LOCAL FormData AS String

m.HTTP = CREATEOBJECT("MSXML2.ServerXMLHTTP.6.0")
m.HTTP.Open("Post", "[URL unfurl="true"]https://www.example.com",[/URL] .F.)

m.FormData = "foo=one" + "&" + "bar=two"

m.HTTP.Send(m.FormData)

? m.HTTP.Status, m.HTTP.Statustext
? "" + m.HTTP.Responsebody

This is the basics of the thing. It can get more complicated than this (for instance, it may involve setting additional information on the request headers, or fetch incidental information from the form itself).
 
I do not want to pass the data through URL because it's possible to have a lot of character and I'm afraid that I'll reach the limit.

But won't a similar limit apply to data that is sent via the form? Wouldn't it be better to put the data in a file and upload it to the server?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top