Page can not be displayed...

P

Piet L.

Hey,
I'm working with IIS (Windows 2000).
I've create a virtual directory usr-cgi met link naar e:\cgi
It works all well when I run simple scripts, but with the following script
I get a "Page can not be displayed" error.

Here is the code:

--------->>>>orders.pm

package orders;

use strict;
use vars qw(@ISA);
use CGI::XMLApplication;
use XML::LibXML;
use DBI;
use XML::Generator::DBI;
use XML::Handler::YAWriter;


@ISA = qw(CGI::XMLApplication);

my $path = "e:/cgi/finaal/";
my $file_name = "orders";
my $xmlfile = "$file_name.xml";
my $xslfile = "$file_name.xsl";
my $xmlfile_path = "$path$xmlfile";
my $xslfile_path = "$path$xslfile";


sub selectStylesheet {
my $self = shift;
my $context
my $style = $context->{STYLE} || $xslfile;
return $path . $style;
}

sub requestDOM {
my $self = shift;
my $context;
fetch_record();
my $xml_file = $context->{REQUEST} || $xmlfile;

my $requested_doc = $path . $xml_file;

my $parser = XML::LibXML->new();
my $doc = $parser->parse_file($requested_doc);
my $root = $doc->getDocumentElement();
return $root;
}

sub fetch_record() {
my $self = shift;
# create a DBI connection
my $dbh = DBI->connect ("DBI:mysql:MyDB", "MYLOGIN", "MYPASSWORD",
{ RaiseError => 1,
PrintError => 0
});

# instantiate a new XML::Handler::YAWriter object
my $out = XML::Handler::YAWriter-> new(
AsFile => "$xmlfile_path",
Pretty => {PrettyWhiteNewline => 0,
PrettyWhiteIndent => 0,
CatchEmptyElement => 1,
CatchWhiteSpace => 0
},
Encoding => "ISO-8859-1",
);

# instantiate a new XML::Generator::DBI object
my $gen = XML::Generator::DBI->new(
Handler => $out,
dbh => $dbh
);

# define the SQL query
my $query1 = "SELECT *
FROM orders
";
warn "SQL $query1";
my $sth1 = $dbh->prepare($query1);
$gen->execute($sth1);
}


--------->>>>orders.cgi

#!/usr/bin/perl -w
use strict;
use CGI qw:)standard);
use lib 'e:/cgi/finaal';
use orders;
my $q = CGI->new();
my %context = ();
my $gateway_name = orders;

$context{STYLE} = $q->param('style') if $q->param('style');
$context{REQUEST} = $q->url(-relative=>1);
$context{REQUEST} =~ s/^$gateway_name\/?//;
$context{REQUEST} ||= 'orders.xml';

my $app = orders->new();
$app->run(%context);




I know the script is working, because when I try it in DOS
e:\cgi\finaal> perl orders.cgi

I get the right output

Problem is the http://localhost/usr-cgi/finaal/orders.cgi

Is there something wrong with my path definition?
 
B

Brian McCauley

Piet said:
Hey,
I'm working with IIS (Windows 2000).
I've create a virtual directory usr-cgi met link naar e:\cgi
It works all well when I run simple scripts, but with the following script
I get a "Page can not be displayed" error.
I know the script is working, because when I try it in DOS
e:\cgi\finaal> perl orders.cgi

I get the right output

Problem is the http://localhost/usr-cgi/finaal/orders.cgi

Most web server software will direct STDOUT from CGI scripts to a log
file somewhere. I've hardly ever used IIS but I think I'd remeber if it
were an exception. Have you tried looking for such a log.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,737
Latest member
Georgeengab

Latest Threads

Top