CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [FishMonger] Need to change browser's title for one page: Edit Log



sunrise11
Novice

Apr 27, 2011, 11:38 AM


Views: 5346
Re: [FishMonger] Need to change browser's title for one page

Okay, I'm ready to tackle this project again after a break.

My next newbie question Blush is, can I mix the HTML template with the original code so that only the header file is using the template and not the body or footer?

Here's an example:


Code
# insert a text file in the result HTML 
sub insert {

use HTML::Template;
my $template = HTML::Template->new(filename => 'header.html');
$template->param(TITLE => 'My chosen title here');
print "Content-Type: text/html\n\n", $template->output;

} elsif ($trigger eq "footer") {
open(FILE,"<$gFooter") || return 0;
} elsif ($trigger eq "info") {
open(FILE,"<$gInfo") || return 0;
} else {
return 0;
}
while (<FILE>) { print; }
close(FILE);
return 1;
} # insert


Or, if I go with a php header, can I mix it up so that the header gets called with the php script and the body and footer get called as per the original script?

Thanks!


(This post was edited by sunrise11 on Apr 27, 2011, 12:08 PM)


Edit Log:
Post edited by sunrise11 (Novice) on Apr 27, 2011, 12:08 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives