Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
It would probably be best to change your open to the complete path to the file that the user wants open.
also, since you seem to be using an editor for your html, why not pull the html out of the perl

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;

and the template:
<HTML> <HEAD> <META NAME="GENERATOR" CONTENT="Adobe PageMill 3.0 Win"> <TITLE>Animetion Station &gt; Video Review &gt; 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>&nbsp;</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>

-p

In reply to Re: Display Troubles by thatguy
in thread Display Troubles by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-24 18:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found