I had this darn app. working just last week. Now I can't get it to work on my web site. I believe all of the code is correct. If one of you could just take a small peek at it, I would be most grateful.
#!/usr/bin/perl
use strict;
# Loads the CGI Module
use CGI;
# creates a new CGI object
my $page = new CGI;
# Grab a named CGI parameter
my $value = $page->param("Comic");
##########declare the names of the files for the loop
my @Comm = ('Images/Le_Comic.jpg', 'Images/Le_Comic2.jpg', 'Images/Le_
+Comic3.jpg',
'Images/Le_Comic4.jpg', 'Images/Le_Comic5.jpg', 'Images/Le_Comic6.jpg'
+,
'Images/Le_Comic7.jpg', 'Images/Le_Comic8.jpg', 'Images/Le_Comic9.jpg'
+,
'Images/Le_Comic10.jpg', 'Images/Le_Comic11.jpg', 'Images/Le_Comic12.j
+pg',
'Images/Thanksgiving_Comic.jpg');
##########
#Open up the comments file
open (FILE, '../Comment.txt') or die "The file could not be opened.\n"
+;
#Save the contents of the FILE handle to an array
my @Comment = <FILE>;
#Close the FILE
close(FILE);
my ('$i','$Como','$Number');
#do a "for" loop to make it choose the quote
for ($i=0; $i<=@Comment; $i++) {
#Do an "if" loop to go through and save the right quote
if ($value eq $Comm[$i]) {
$Como = $Comment[$i];
#Save the number of the quote to a variable for the title
$Number = $i + 1;
}
}
## Then:
# This will print a standard HTML header
print $page->header;
print "<HTML><HEAD>\n";
print <<ENDMETA;
<META NAME="GENERATOR" CONTENT="Adobe PageMill 3.0 Win">
<TITLE>Animetion Station > Webcomic > Comic #$Number</titl
+e>
<LINK REL="stylesheet" HREF="../Style.css" TYPE="text/css">
ENDMETA
print "</head><BODY>\n";
print <<ENDHTML;
<P><CENTER><DIV STYLE="background-color: #0099FF; font-family: Comic S
+ans MS; font-size: 20px; width: 200px; color: white;">Web
Comics</div></center></p>
<P><TABLE WIDTH="757" BORDER="0" CELLSPACING="1" CELLPADDING="0" HEIGH
+T="294">
<TR>
<TD WIDTH="14%" VALIGN="TOP" ALIGN="CENTER" HEIGHT="293">
<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="86%" VALIGN="TOP" BGCOLOR="#3366ff">
<P><CENTER><IMG SRC="../$value"></center></p>
<br>
<p>$Como</p>
<CENTER>
<DIV STYLE="font-family: Times New Roman,Times; color: white; widt
+h: 350px; background-color: gray; text-align: center;">
<P><B><U>Comics</u></b></p>
<P>
<A HREF="Testy.cgi?Comic=Images%2fLe_Comic.jpg">Comic #1</a> |
<A HREF="Testy.cgi?Comic=Images%2fLe_Comic2.jpg">Comic #2</a> |
<A HREF="Testy.cgi?Comic=Images%2fLe_Comic3.jpg">Comic #3</a> |
<A HREF="Testy.cgi?Comic=Images%2fLe_Comic4.jpg">Comic #4</a> |
+
<A HREF="Testy.cgi?Comic=Images%2fLe_Comic5.jpg">Comic #5</a><br
+>
<A HREF="Testy.cgi?Comic=Images%2fLe_Comic6.jpg">Comic #6</a> |
<A HREF="Testy.cgi?Comic=Images%2fLe_Comic7.jpg">Comic #7</a> |
<A HREF="Testy.cgi?Comic=Images%2fLe_Comic8.jpg">Comic #8</a> |
<A HREF="Testy.cgi?Comic=Images%2fLe_Comic9.jpg">Comic #9</a> |
<A HREF="Testy.cgi?Comic=Images%2fLe_Comic10.jpg">Comic #10</a><
+br>
<A HREF="Testy.cgi?Comic=Images%2fLe_Comic11.jpg">Comic #11</a>
</p>
<p>
<center><u><font type="Comic Sans MS" size="4">Special Comic</fon
+t><u></center><br>
<A href="Testy.cgi?Comic=Images%2fThanksgiving_Comic.jpg">Thanksg
+iving Comic</a>
</p>
</div>
</center>
</td>
</tr>
</table>
ENDHTML
print "</body></html>\n";
Edit kudra,
2001-12-02
Changed title
-
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.