The code is exactly the same in both cases.  Here is more detail:


use LWP::Simple;
use CGI;
CGI::ReadParse(*in);

$q=new CGI;     #invoke CGI object
print $q->header('text/html');

#unfix passed url to true url
$url1 = $in{"site"};
$url1 =~ s/----/\?/;
$url1 =~ s/\*\*\*\*/&/g;

#check for existence of Internet site by bringing back header
#test only if not a forced read of backup
if (!$in{"backit"}){
        $base_url=$url1;
        $test=head($base_url);
}

if ($test && !$in{"backit"}) {
        #website was found
        $topframe=0;
        $site=$url1;            #use link to website
} else {
        #website was not found
        $topframe=10;
        #find full name of archived file
        @types = qw(html pdf txt doc gif jpg xml shtml shtm asp htm);
        foreach $type (@types) {
                $arch_url = 
"http://xxx.cecinc.com/msdsSaved/backup/".$in{"id"}.".".$type;
                $test=head($arch_url);
                if ($test) {
                        $site=$arch_url;
                        if ($in{"backit"}) {
                                $banner="forced.html"           #if forced backup, 
display notice
                        } else {
                                $banner="warning.html"          #if site wasn't found, 
display warning
                        }
                        last;
                }
        }
}


-----Original Message-----
From: Jos I. Boumans [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 20, 2001 4:47 PM
To: Deb Thompson; [EMAIL PROTECTED]
Subject: Re: LWP


forgive me if i miss the obvious, but the below is, i think, the same as:

 if (head($in{"site"}) && !$in{"backit"}) { ... }

and i can't deduce any 'gut code' from that from which i might retrieve the
error...
so maybe you can post what worked before and what doesnt now?

regards,

Jos Boumans


> I've written a program that checks for the existence of a website by
> retrieving an HTTP header when fed a URL.  It works beautifully on my
server
> (NT running Windows '98) but locks when I installed it on my client's
server
> (NT running Windows 2000).  The important guts of the code are:
>
> use LWP::Simple;
> use CGI;
> CGI::ReadParse(*in);
>
> #etc.
> $url1 = $in{"site"};
> if (!$in{"backit"}){
> $base_url=$url1;
> $test=head($base_url);
> }
>
> if ($test && !$in{"backit"}) {


Tracking #: 381B87A7A965D511954600508BC28C5A67CDE618

Reply via email to