Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI not reporting data to html page with SSI directive

Status
Not open for further replies.

MACHENRY

Technical User
Nov 27, 2002
3
US
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=&quot;cgi-bin/getstory.pl&quot; -->

The getstory.pl script which is the one doing the parsing is as follows:

Code:
#!/usr/bin/perl
open (GBOOK,&quot;cgi-bin/lot.rec&quot;);
@in = <GBOOK>;
close GBOOK; 
print &quot;Content-type: text/html\n\n&quot;;
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(&quot;C&quot;, hex($1))/eg;
  $book{$nam} = $val;
  }
print &quot;$book{'Name'}&quot;,
print &quot; visited this site.<br>\n&quot;;
print &quot;e-mail: $book{'email'}&quot;;
print &quot;<BR>\n&quot;;
print &quot;and posted this story ending:  $book{'story_text'}&quot;;
print &quot;<HR>\n&quot;
}


This is all very new to me. What am I doing wrong?
 
A friend solved the problem. We changed the line

open (GBOOK,&quot;cgi-bin/lot.rec&quot;);

to

open (GBOOK,&quot;./lot.rec&quot;);

Apparently wasn't finding the data files.
 
Sorry - submitted too soon.

Besides changing the line

GBOOK,&quot;cgi-bin/lot.rec&quot;;

to

GBOOK,&quot;./lot.rec&quot;;

we also took the SSI directive line out of the smgbook.html and put the entire file from getstory.pl in its place, renaming the file smgbook.pl. No need for the SSI directive which probably was going to require an execute change in the SSIEnableCMDDirective registry property.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top