I need to use a javascript function with this open the output in a new window of a certain size. I thought I could do it with a simple target statement on the html/javascript side. Of course it puts the data output into a new window but will not size the window, even with correct height and width attributes. Any ideas, how I can do that in this simple cgi?
#!/usr/bin/perl
require "cgi-lib.pl";
$match="no";
&ReadParse;
print &PrintHeader;
open (FILE,"fake.txt") || die "Can't find database\n";
@indata = <FILE>;
close (FILE);
print <<"PrintTag";
<html>
<head>
<title>Search Results</title>
</head>
<body BGCOLOR=#FFFFFF>
<table border=1 align="center">
<tr>
<th>Date</th>
<th>School 1</th>
<th>Score 1</th>
<th>School 2</th>
<th>Score 2</th>
<th>Where</th>
</tr>
PrintTag
foreach $i (@indata)
{
chop($i);
($ID,$Date,$Where,$School1,$Score1,$School2,$Score2) = split(/\|/,$i);
if ($School1=~/$in{'School1'}/i)
{
$match="yes";
print "<tr>";
print "<td>$Date</td>";
print "<td>$School1</td>";
print "<td>$Score1</td>";
print "<td>$School2</td>";
print "<td>$Score2</td>";
print "<td>$Where</td>";
print "</tr>\n";
}
}
print "</table>";
if ($match eq "no")
{
print "<p>Sorry. No matching records were found.</p>";
}
print "</body></html>";
#end
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.