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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

headers with no SSI

Status
Not open for further replies.

chevyv8

MIS
Apr 19, 2004
14
GB
My ISP allows me to use SSI in my HTML pages, this makes it easy to create headers, footers and menus but now I have to move the site to another ISP that does not allow SSI but does allow Perl CGI, my question what do I need to replace the include statements with to make the web site work again?
 
You could try using the require statment remembering you will have to assign a library folder first, and put the headers/footers/menus etc in as sub routines:
Code:
use lib "../cgi-bin/LIB";
require "MySubs.pl";

Don't forget that the headers/footers/menus may need to be converted from straightforward HTML to Perl.

You could also put the HTML files into the library folder, and require "" them individually from there, although I've never tried this as I don't tend to deal with CGI that much.

Rob Waite
 
If your new ISP doesn't allow SSI, you're going to have to go with a different solution altogether. Simply replacing those statements won't work. Perl isn't really made to do what you're looking for, but if you were to write programs that dynamically added the content of your page, you could implement a solution in Perl. Also, there are some Modules that could help out as well such as HTML::Template, but you still have the issue with needing to write a Perl script to render the page.

In lieu of using Perl, I would suggest going with PHP as it is a minimal change for your pages this way. While I won't claim to know vast amounts of knowledge in PHP, I know it can be done by using PHP includes. Put a request in with the PHP forum ( forum434 ) to find out how this is done.

- Rieekan
 
A nasty way, and not ideal by any means, would be to have perl generate javascript for you
Code:
<script language=javascript src=/cgi-bin/header.pl></script>
<noscript>If you had javascript enabled you'd see this page how we designed it</noscript>

header.pl
Code:
#!/usr/bin/perl
print "Content-Type: text/javascript\n\n";
$header=qq(All the stuff you need in here);
print "document.write($header);

It's got me out of a hole in the past for a few small audience sites. BUT, not ideal, coz some people don't enable javascript in their browser

Just another route
--Paul

Nancy Griffith - songstress extraordinaire,
and composer of the snipers anthem "From a distance ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top