Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to send a 'filled out' form to a web site...
Message
 
To
26/08/1999 19:06:53
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00258164
Message ID:
00258676
Views:
14
>>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...

Hi,
For the pause and polling - use this:

do while not oie.readystate=4
enddo

When a page has been downloaded readystate returns 4 and you can continue the execution.

/Pierre Unge, Sweden
------------- if you cut here, you'll probably destroy your monitor ------------
Previous
Reply
Map
View

Click here to load this message in the networking platform