I have a Perl script that I run using telnet that creates static HTML pages. I put in a simple SSI for a footer on a template that is used to make some of the pages. Then I run the script and check the Internet and the footer is never their. How do I make sure that the SSI will work? Thanks ahead...
Jan 21, 2003, 8:45 AM
Novice (14 posts)
Jan 21, 2003, 8:45 AM
Post #3 of 16
Views: 14265
The template file extension is .shtml. The code used to call the footer is
<!--#include virtual="footer.htm" -->
So obviously this code is not getting to the outputted shtml pages or I would see the footer after I run the perl from telnet. Do I need to wrap it or parse it or ????
Regular SSI works on my server on regular pages.
<!--#include virtual="footer.htm" -->
So obviously this code is not getting to the outputted shtml pages or I would see the footer after I run the perl from telnet. Do I need to wrap it or parse it or ????
Regular SSI works on my server on regular pages.
Jan 21, 2003, 8:47 AM
Veteran (19537 posts)
Jan 21, 2003, 8:47 AM
Post #4 of 16
Views: 14289
If you are loding the .shtml normally, ie not parsing it through your cgi script, then it looks like it should work fine.
You are going directly to the .shtml file from your browser?
SSI won't work if you are loading the template through your perl script.
You are going directly to the .shtml file from your browser?
SSI won't work if you are loading the template through your perl script.
Jan 21, 2003, 8:52 AM
Novice (14 posts)
Jan 21, 2003, 8:52 AM
Post #5 of 16
Views: 14332
Perl script is using the template, which has the incude file. The perl script is creating static shtml pages which is supposed to have the footer on it. You are saying that if perl creates the pages that the SSI won't show up? Is their no way to get around this? That would mean I would have to go and add footers and headers to 30,000 pages after perl uses the template to create them.
Jan 21, 2003, 8:56 AM
Veteran (19537 posts)
Jan 21, 2003, 8:56 AM
Post #6 of 16
Views: 14313
What I mean is that you can't use SSI inside a cgi script, so for example you created a .shtml file with your SSI in it and then did....
print while (<FILE>);
close FILE;
...that wouldn't work because you are actually just printing the template through your perl script which will not be parsed by the SSI parser.
However the following would work:
print NEW qq|<!--#include virtual="/foo/bar.html"-->|;
close NEW;
...as you are just printing out the shtml file which will be visited directly as a .shtml.
So in other words, if your script is just generating the .shtml files as in example two above then it will work, however if you are doing something similar to example one, then it won't.
Code:
open FILE, "/path/to/include.shtml" or die $! print while (<FILE>);
close FILE;
...that wouldn't work because you are actually just printing the template through your perl script which will not be parsed by the SSI parser.
However the following would work:
Code:
open NEW, ">/path/to/www/new.shtml" or die $!; print NEW qq|<!--#include virtual="/foo/bar.html"-->|;
close NEW;
...as you are just printing out the shtml file which will be visited directly as a .shtml.
So in other words, if your script is just generating the .shtml files as in example two above then it will work, however if you are doing something similar to example one, then it won't.
Jan 21, 2003, 9:06 AM
Novice (14 posts)
Jan 21, 2003, 9:06 AM
Post #7 of 16
Views: 14313
I am confused what to put on the template page. It is just a regular shtml page that has html on it and gets used to make other pages. It is on this page that I want to put the footer.htm SSI. The perl program grabs the template file called home.shtml to make 1000's of other pages and on home.shtml at the bottom is
<!--#include file="footer.htm" -->
which should show the contents of footer.htm on all of the pages that are made with home.html.
<!--#include file="footer.htm" -->
which should show the contents of footer.htm on all of the pages that are made with home.html.
Jan 21, 2003, 9:11 AM
Novice (14 posts)
Jan 21, 2003, 9:11 AM
Post #9 of 16
Views: 14268
http://www.jaspergifts.com/...les_main_index.shtml
This is one of the pages that should show the footer.htm at the bottom. When the footer.htm is present it looks like this:
http://www.jaspergifts.com
Scroll to the bottom to see the Sponsers and Other Partners section which is the footer.htm
This is one of the pages that should show the footer.htm at the bottom. When the footer.htm is present it looks like this:
http://www.jaspergifts.com
Scroll to the bottom to see the Sponsers and Other Partners section which is the footer.htm
Jan 21, 2003, 9:14 AM
Veteran (19537 posts)
Jan 21, 2003, 9:14 AM
Post #10 of 16
Views: 14300
Ok I see. One thing I noticed is that your footer is a complete html page so you have:
<html>
<head>
...etc...
...within the middle of your main page.
I don't see a reason as to why the footer isn't loading as both .shtml pages are in the same directory.
Is the ssi include in the main page _exactly_ the same as the one in the broken page?
<html>
<head>
...etc...
...within the middle of your main page.
I don't see a reason as to why the footer isn't loading as both .shtml pages are in the same directory.
Is the ssi include in the main page _exactly_ the same as the one in the broken page?
Jan 21, 2003, 9:25 AM
Novice (14 posts)
Jan 21, 2003, 9:25 AM
Post #11 of 16
Views: 14279
The tag is
<!--#include virtual="footer.htm" -->
This is on home.shtml which is deep in the CGI-bin. I telnet to the the script which I execute and it takes home.shtml and makes the following page:
http://www.jaspergifts.com/...les_main_index.shtml
As you can see the SSI footer does not get put on the static page that the perl script makes.
<!--#include virtual="footer.htm" -->
This is on home.shtml which is deep in the CGI-bin. I telnet to the the script which I execute and it takes home.shtml and makes the following page:
http://www.jaspergifts.com/...les_main_index.shtml
As you can see the SSI footer does not get put on the static page that the perl script makes.
Jan 21, 2003, 11:45 AM
Novice (14 posts)
Jan 21, 2003, 11:45 AM
Post #12 of 16
Views: 14243
A partial breakthrough...If you check out my page in question,
http://www.jaspergifts.com/...les_main_index.shtml
you will see that I have managed to place the footer in two places above the mfg's alphabetical list but when I try to put it below the list, where the footer belongs, it is not incuded?
http://www.jaspergifts.com/...les_main_index.shtml
you will see that I have managed to place the footer in two places above the mfg's alphabetical list but when I try to put it below the list, where the footer belongs, it is not incuded?
Jan 21, 2003, 4:38 PM
Veteran / Moderator (4108 posts)
Jan 21, 2003, 4:38 PM
Post #15 of 16
Views: 14275
Have you looked at the various SSI modules on CPAN to help you embed SSI in Perl scripts?
http://search.cpan.org/...ery=ssi&mode=all
- wil
http://search.cpan.org/...ery=ssi&mode=all
- wil