in reply to Display Troubles
Look into HTML::Template. It will make site updates much nicer and break less perl. html::template tutorial.
here are the changes I would make:
cgi file:
#!/usr/bin/perl -wT use strict; my $video_info; # Loads the CGI Module use CGI; # creates a new CGI object my $page = new CGI; # This will print a standard HTML header print $page->header; # Grab a named CGI parameter my $value = $page->param("video"); #Open up the file that contains the review of the video open(SEE, "/var/www/docs/$value") or $video_info="$!"; while(<SEE>){ #put data from review into variable $video_info .= "$_"; } #close file close(SEE); #Now print out lots of HyperText Mark-up Language using # HTML::Template my $template = HTML::Template->new(filename => 'my.tmpl'); $template->param(info => $video_info); print $template->output; exit;
<HTML> <HEAD> <META NAME="GENERATOR" CONTENT="Adobe PageMill 3.0 Win"> <TITLE>Animetion Station > Video Review > Oh MY Goddess! Volum +e 1</title> <LINK REL="stylesheet" HREF="../Style.css" TYPE="text/css"> </head> <BODY TEXT="#ffffff"> <P STYLE="background-color: #3257b8; width: 350px;"><I><FONT SIZE="+3" FACE="Garamond">Animetion Station</font></i></p> <div id="Bottom"> <P><I><FONT SIZE="+2" FACE="Garamond">Video Review</font></i></p> </div> <P><CENTER> </center></p> <P><TABLE WIDTH="738" BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="24"> <TR> <TD WIDTH="67" VALIGN="TOP"> <div class="Standard"> <P><CENTER><A HREF="../index.htm">[Home]</a> <HR> <A HREF="../Gallery.shtml">[Gallery]</a> <HR> <A HREF="../Manga.shtml">[Manga]</a> <HR> <A HREF="../Video_Review.shtml">[Video Reviews]</a> <HR> <A HREF="../Links.shtml">[Links]</a> <HR> <A HREF="../Web_Comic.shtml">[Web Comic]</a></center></td> <TD VALIGN="TOP" WIDTH="270" HEIGHT="131"> </div> </td> <TD WIDTH="382" VALIGN="TOP"> <!-- this is the bit that HTML::Template wants so it knows where to pu +t the value of $video_info --> <TMPL_VAR NAME="info"> <!--VIDEO REVIEW LINKS--> <P STYLE="background-color: darkBlue;"> <A HREF="cgi-bin/Video_Gen.cgi?video=Video_Txt_Files%2fBattle_Skip +per_Vol_1.txt">Battle Skipper Volume One by Ertain</a><BR> <A HREF="cgi-bin/Video_Gen.cgi?video=Video_Txt_Files%2fOMG_Vol_1.t +xt">Oh My Goddess! Volume One by Ertain</a><BR> <A HREF="cgi-bin/Video_Gen.cgi?video=Video_Txt_Files%2fOMG_Vol_2.t +xt">Oh My Goddess! Volume Two by Ertain</a><BR> <A HREF="cgi-bin/Video_Gen.cgi?video=Video_Txt_Files%2fOMG_Vol_3.t +xt">Oh My Goddess! Volune Three by Ertain</a><BR> <A HREF="cgi-bin/Video_Gen.cgi?video=Video_Txt_Files%2fOMG_Vol_4.t +xt">Oh My Goddess! Volume Four by Ertain</a><BR> <A HREF="cgi-bin/Video_Gen.cgi?video=Video_Txt_Files%2fOMG_Vol_5.t +xt">Oh My Goddess! Volume Five by Ertain</a></p> </td> </tr> </table> </body> </html>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Display Troubles
by mr_dont (Beadle) on Oct 09, 2001 at 00:27 UTC | |
by blakem (Monsignor) on Oct 09, 2001 at 01:44 UTC |