I have a CGI script running on an IIS server using Perl and Windows 2000 OS. The script is called using an SSI directive from an HTML document. I can get all the HTML to work and data is going into the data file, but I am having a problem getting the CGI to report the data to the screen. I really need this working for a school demonstration Dec. 3!
The page I am working on is located at the following link (click "complete" button under "The Lady or the Tiger" and then choose the lady):
Once the reader submits the form, the choice to "Read what others have said" calls the html page smgbook.html that has the SSI directive in it. When I look at the page source of smgbook.html, I do not see the SSI directive, so I assume it has been executed, but nothing prints out except the html page and html links.
The SSI directive is
<!--#exec cgi="cgi-bin/getstory.pl" -->
The getstory.pl script which is the one doing the parsing is as follows:
This is all very new to me. What am I doing wrong?
The page I am working on is located at the following link (click "complete" button under "The Lady or the Tiger" and then choose the lady):
Once the reader submits the form, the choice to "Read what others have said" calls the html page smgbook.html that has the SSI directive in it. When I look at the page source of smgbook.html, I do not see the SSI directive, so I assume it has been executed, but nothing prints out except the html page and html links.
The SSI directive is
<!--#exec cgi="cgi-bin/getstory.pl" -->
The getstory.pl script which is the one doing the parsing is as follows:
Code:
#!/usr/bin/perl
open (GBOOK,"cgi-bin/lot.rec");
@in = <GBOOK>;
close GBOOK;
print "Content-type: text/html\n\n";
foreach (reverse(@in)) {
@nvp = split(/&/);
foreach $nvp (@nvp) {
($nam, $val) = split(/=/,$nvp);
$val =~ s/\+/ /g;
$val =~ s/%([a-fA-F0-9]
[a-fA-F0-9])/pack("C", hex($1))/eg;
$book{$nam} = $val;
}
print "$book{'Name'}",
print " visited this site.<br>\n";
print "e-mail: $book{'email'}";
print "<BR>\n";
print "and posted this story ending: $book{'story_text'}";
print "<HR>\n"
}
This is all very new to me. What am I doing wrong?