On Wed, 19 Sep 2001, SAWMaster wrote:
> #!c:\perl\bin\perl -w
>
> use DBI;
> $dbh = DBI->connect('dbi:ODBC:gallery');
> print "Content-type: text/html\n\n";
> print qq~<LINK HREF="/wholesalegallery/wg.css" REL="stylesheet"
> TYPE="text/css">~;
> print qq~<HTML>\n~;
> print qq~<CENTER>\n<H1>Online Gallery</H1>\n</CENTER>\n~;
> $sqlstatement="SELECT pid, name, description, picture, opendate, price FROM
> gallery ORDER BY pid";
> $sth = $dbh->prepare($sqlstatement);
> $sth->execute || die "Could not execute SQL statement ... maybe invalid?";
> print qq~<FORM NAME = GALLERY>\n~;
> print qq~<TABLE WIDTH = 100%>\n~;
> while (@row=$sth->fetchrow_array)
> {
> print qq~<TR><TD ROWSPAN = 5>$row[3]</TD><TD = 50%>Product ID:
> $row[0]</TD>\n~;
> print qq~<TR><TD WIDTH=50%>Product name: $row[1]</TD></TR>\n~;
> print qq~<TR><TD WIDTH=50%>Description: $row[2]</TD></TR>\n~;
> print qq~<TR><TD WIDTH=50%>Opening date: $row[4]</TD></TR>\n~;
> print qq~<TR><TD WIDTH=50% VALIGN="top">Price: \$~;
> printf "%.2f", $row[5];
> print qq~<INPUT TYPE = CHECKBOX NAME = $row[0]>BUY<BR>\n~;
> print qq~</TD></TR>\n~;
> print qq~<TR><TD COLSPAN = 2><HR></TD></TR>\n~;
> }
> print qq~</TABLE>\n~;
> print qq~</FORM>\n~;
> print qq~</HTML>\n~;
Your HTML is not structured correctly because you don't have
<BODY></BODY> enclosing everything.
For things like this, I recommend using HERE docs or CGI.pm -- it's
difficult to read and debug the HTML with all of those print statement,
and CGI.pm takes care of things like headers, CGI parameter parsing and
will make your life a lot esier in the long run.
-- Brett
http://www.chapelperilous.net/
------------------------------------------------------------------------
Someone is unenthusiastic about your work.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]