Current location: Hot Scripts Forums » Programming Languages » Perl » Dynamic title


Dynamic title

Reply
  #1 (permalink)  
Old 02-08-04, 02:44 PM
hyperrad hyperrad is offline
New Member
 
Join Date: Feb 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Dynamic title

1.) How do I make the title dynamic with a template based perl page?
Reply With Quote
  #2 (permalink)  
Old 02-09-04, 05:15 PM
Skeleton Man Skeleton Man is offline
Community Liaison
 
Join Date: Jun 2003
Location: Australia
Posts: 406
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by hyperrad
1.) How do I make the title dynamic with a template based perl page?
Use something as follows:

In the head of the template file:

Code:
<HTML>
<head>
<title><!--PAGE_TITLE--></title>
</head>
In the script (assuming you have read the contents of the tempate into an array called @file):

Code:
$title = "The title of my page..";

print "Content-type: text/html\n\n";

foreach $line (@file){
 $line =~ s/<!--PAGE_TITLE-->/$title/;
 print $line;
}
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Classified Ads skipper23 Perl 3 11-22-05 02:22 AM
Classified Ads skipper23 Perl 2 12-30-03 03:43 AM
fetching title from another page rdnpa JavaScript 2 12-14-03 11:41 AM
Include makes 2 title tags. Need to pre-delete one at include.. cebuy PHP 4 12-02-03 10:58 AM
dynamic uploader (progress bar) [PL]Greg PHP 8 07-02-03 12:07 PM


All times are GMT -5. The time now is 04:55 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.