LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-24-2005, 11:04 AM   #1
SkipHuffman
Member
 
Registered: Mar 2005
Posts: 81

Rep: Reputation: 15
CGI works from SSI exec, but not from include.


This page:

Code:
<html>
        <head>
                <title>Hit Me</title>
        </head>
        <body>
                <h2>Test Page</h2>
                <ol>
                        <li><!--#include virtual="something.html"-->
                        <li><!--#include virtual="../cgi-bin/Hello.pl"-->
                        <li><!--#exec        cmd="../cgi-bin/Hello.pl" -->
                        <li><!--#include virtual="something_else.html"-->
                </ol>
                <p> end testing
        </body>
</html>
This cgi:
Code:
#!/usr/bin/perl -wT

print "<H2>Hello</h2>";
This result:
Code:
Test Page

   1.      something
   2. [an error occurred while processing this directive]
   3.      Hello
   4.      something else 

end testing
Why does the script fail on item 2 but succed on item 3?

Thanks
 
Old 08-25-2005, 09:27 PM   #2
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
your CGI script didn't output an HTTP header. Try something like this:
Code:
#!/usr/bin/perl -wT

print "Content-type: text/html\n\n";
print "<H2>Hello</h2>";

Last edited by spooon; 08-25-2005 at 09:28 PM.
 
Old 08-25-2005, 10:15 PM   #3
SkipHuffman
Member
 
Registered: Mar 2005
Posts: 81

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by spooon
your CGI script didn't output an HTTP header. Try something like this:
Code:
#!/usr/bin/perl -wT

print "Content-type: text/html\n\n";
print "<H2>Hello</h2>";
Why would I need a content type header in the middle of the document?

Anyway, I went ahead and put that in, no effect.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSI works from #exec, but not from #include. SkipHuffman Linux - General 4 08-25-2005 07:16 AM
Include ssi in a form? @ngelot Programming 4 05-11-2005 07:39 AM
SSI include line from text-file? @ngelot Programming 4 05-11-2005 06:43 AM
ssi and cgi not working... Flawless Slackware 12 03-09-2003 09:38 PM
Apache and SSI/CGI PROBLEMS morbo Linux - Networking 2 01-18-2003 04:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration