Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access the response from a web site
Message
From
16/02/2006 14:24:54
Pamela Bulmahn
The University of Iowa
Iowa, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Internet applications
Title:
Access the response from a web site
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01096847
Message ID:
01096847
Views:
55
We have a web site to validate general ledger numbers.
The url includes the site name with a parameter containing the GL number to validate.
The site returns 2 pieces of information; 0 for invalid, 1 for valid, and a brief message as to what is invalid.

Another department has provided a perl script that will capture the returned values and print them. I want to capture the return values and process them.

The perl script is:
#!/usr/local/bin/perl

use LWP;

my $webapp = "put the http:// url here";
my $mfk = "put the GL number here";
my $query = "$webapp?mfk=$mfk";
my $ua = new LWP::UserAgent;
my $request = new HTTP::Request( "GET", $query );
my $response = $ua->request( $request );

($valid, $message) = (split( /\n/, $response->content() ));

if( $valid eq "1" ) {
print "Valid! - $message\n";
} elsif( $valid eq "0" ) {
print "Invalid! - $message\n";
} else {
print "Error! - $message\n";
}


Is there a way to write this in VFP?

I have tried using hyperlink but it does not have a way to access the return value.

Thank you for your assistance.

Pamela
Next
Reply
Map
View

Click here to load this message in the networking platform