homepage Welcome to WebmasterWorld Guest from 54.243.13.30
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Accredited PayPal World Seller

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
Flatfile Database Problems
Perl will not give HTML page output
Myrkur




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

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




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

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

Content-type: text/html

Myrkur




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved