Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6932337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:41:35+00:00 2026-05-27T11:41:35+00:00

I am trying to wrap my head around some CGI scripting (the embedded box

  • 0

I am trying to wrap my head around some CGI scripting (the embedded box I’m on doesn’t quite like PHP) and I have a question about how CGI perl scripts interact with apache and some HTML sites on it.

Basically, I need part of the HTML file to load based on a config file outside of the document root. Obviously, this is where CGI steps in. Now, the problem is that CGI scripts also shouldn’t be in your doc root, so I can’t just put the script in my doc root and make it fire out HTML. So, I put my script in /var/www/cgi/, and pointed apache to it.

That part runs nicely, and it fires out an HTML page like it should. However, the original site has some resources in its doc root (css files, java applets, images, etc), that my new CGI-made HTML doesn’t have access to. So, what would be the best way to make the HTML page “build itself” off the CGI script? I have read a few things on Server side includes, which is one option. There is also the option of putting the CGI output in a <div src="script"></div>, and a couple others. The question is, what is the best way of doing this? I would appreciate any advice. Thanks beforehand!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:41:36+00:00Added an answer on May 27, 2026 at 11:41 am

    Well, Perl might be overkill for something like that (like you said, you can do it with X-SSI), but it sounds like what you might want is to embed the fragment of Perl code into your otherwise-static HTML documents?

    If you have mod_include, you can do something like:

       <applet … >
         <!--#exec cgi="/cgi-bin/readconfig.cgi" -->
       </applet>
    

    and just have readconfig.cgi write out a fragment like

       #!/usr/bin/perl -WT
    
       print "Content-Type: text/html\n\n";
    
       open my $config, '<', '/foo/bar/baz.qux'
           or die "<!-- can't read baz.qux: $! -->";
    
       my $line = <$config> until $line =~ /interesting: ([a-z]+[0-9]+)/;
       my $interesting = $1;
       print qq[
              <param value="$interesting" />
       ];
    

    You’ll need to enable Options +includes to parse X-SSI, possibly by dropping it in an .htaccess file, depending on your setup…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to wrap my head around some WPF specific stuff, and have
Here, is my code. Just trying to wrap my head around some of the
I'm trying to wrap my head around Object Oriented programming. But I'm having some
I'm trying to wrap my head around asp.net. I have a background as a
I'm starting Objective-C Development and I'm trying to wrap my head around how some
Probably a stupid question but I'm still trying to wrap my head around nHibernate.
For sometime now, I have been trying to wrap my head around the reason
I'm trying to wrap my head around RESTful design, and I'd like to understand
I'm trying to wrap my head around multiple inheritance in python. Suppose I have
I'm still trying to wrap my head around iphone memory management. I have checked

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.