Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need to send a 'filled out' form to a web site...
Message
De
26/08/1999 19:06:53
 
 
À
26/08/1999 17:28:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00258164
Message ID:
00258209
Vues:
19
>There's a credit card validation site... where we type in the credit card number, amount, address, etc. The service then verifies that the amount is available on the card and displays a 'response' page...
>
>I need to send this data and get the response from within VFP...
>
>any ideas??
>
>TIA

There are a couple of ways you can do this. Perhaps the easiest requires that the machine have IE installed, and then you can run some code like this...

oIE = CREATEOBJECT("InternetExplorere.Application")
oIE.Navigate("http://www.somesite.com/someccvalidationpage.htm")
* pause here, perhaps polling...

oIE.Document.Forms(0).ccNumber.Value="1234-1234-1234-1234"
oIE.Document.Forms(0).ccExpDate.Value="01/99"
oIE.Document.Forms(0).Submit()

* pause here, perhaps polling...
?oIE.Document.Body.InnerText && displays the text of the resulting page.

To find the names of the form variables to use, view source on the page that accepts the CC info, and look for the names of the text fields that accept entry. Also, if there is more than one form on the page, you'' need to specify it's name instead of 0, or figure out it's correct ordinal position (the forms collection is a 0 based collectoin): 0 is the first form).

The other easy way is with Rick Strahl's wwIPStuff. This doesn't require IE on the machine (except on very old versions of Win95), because it uses WinInet.dll for connectivity.

wwIPStuff comes with a lot of documentation on how to post form variables and submit requests...
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform