Welcome to WebmasterWorld Guest from 54.144.126.195

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Flatfile Database Problems

Perl will not give HTML page output

     

Myrkur

6:15 pm on Jul 10, 2003 (gmt 0)

10+ Year Member



Hello, I'm a newbie to this board and to Perl. I am trying to create an inventory database for my employer, but cannot get it to output an HTML page like it's supposed to. A link to my program is here, and my code is below:

#!/usr/local/bin/perl

print "Content-type: html\n\n";
print "<html><head>";
print "<title>Inventory</title>";
print "</head>";
print "<body>";
print "<table>";
print "<tr>";
print "<th>item</th><th>description</th><th>on hand</th><th>on order</th>";
print "</tr>";

open (DB,"skyinv") die("There was a problem opening the file.");
while ($entry=<DB>) {
@fields=split(/\/,$entry);
print "<tr>";
print "<td>$fields[0]</td>";
print "<td>$fields[1]</td>";
print "<td>$fields[2]</td>";
print "<td>$fields[3]</td>";
print "</tr>";
}
close DB;

print "</table>";
print "</body>";
print "</html>";

[edited by: jatar_k at 7:15 pm (utc) on July 10, 2003]
[edit reason] no personal urls thanks [/edit]

gsx

6:20 pm on Jul 10, 2003 (gmt 0)

10+ Year Member



Your content type needs to be of a text file type:

Content-type: text/html

Myrkur

3:51 pm on Jul 11, 2003 (gmt 0)

10+ Year Member



*slaps forhead* OH! I knew that. Thank you very much.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month