Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access the response from a web site
Message
De
16/02/2006 14:24:54
Pamela Bulmahn
The University of Iowa
Iowa, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Titre:
Access the response from a web site
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01096847
Message ID:
01096847
Vues:
54
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform