×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Populate a web form from vfp

Populate a web form from vfp

Populate a web form from vfp

(OP)
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.

RE: Populate a web form from vfp

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 "https://www.example.com".

You want to fill the form with the values "one" and "two".

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

CODE --> VFP

LOCAL HTTP AS MSXML2.ServerXMLHTTP60
LOCAL FormData AS String

m.HTTP = CREATEOBJECT("MSXML2.ServerXMLHTTP.6.0")
m.HTTP.Open("Post", "https://www.example.com", .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).

RE: Populate a web form from vfp

Quote:

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close