In this case, it's an SQl db. I have:

search.cgi - Only the relevant form
sub normal_results{ print <<HTML; <HTML><HEAD><TITLE>search- Timeclock Search</TITLE></HEAD> <BODY BGCOLOR="#FFFFFF"> <CENTER> <a href="$home">Home</A> | <a href="in_form.cgi">Clock In</A> | <a href="search_form.cgi">Search</A> </CENTER> <CENTER><FONT SIZE=6 FACE=ARIAL>Search Results for $username</FONT> +</CENTER> <HR WIDTH=80%> <P> <CENTER><TABLE BORDER=1 CELLSPACING=0> <TR> <TD BGCOLOR="#eecb27" COLSPAN=7><FONT FACE=ARIAL> <CENTER><B>- Employee Timeclock Database</B></CENTER> </FONT></TD> </TR> <TR> <TD BGCOLOR="eecb27"> <FONT SIZE=2 FACE=ARIAL><CENTER><B>Oid</B></CENTER></FONT></TD> <TD BGCOLOR="eecb27"> <FONT SIZE=2 FACE=ARIAL><CENTER><B>Date</B></CENTER></FONT></TD> <TD BGCOLOR="eecb27"> <FONT SIZE=2 FACE=ARIAL><CENTER><B>Username</B></CENTER></FONT>< +/TD> <TD BGCOLOR="eecb27"> <FONT SIZE=2 FACE=ARIAL><CENTER><B>Clocked In</B></CENTER></FONT +></TD> <TD BGCOLOR="eecb27"> <FONT SIZE=2 FACE=ARIAL><CENTER><B>Clocked Out</B></CENTER></FON +T></TD> <TD BGCOLOR="eecb27"> <FONT SIZE=2 FACE=ARIAL><CENTER><B>Daily Total</B></CENTER></FON +T></TD> <TD BGCOLOR="eecb27"> <FONT SIZE=2 FACE=ARIAL><CENTER><B>notes</B></CENTER></FONT></TD +> </TR> HTML while (@row = $sth->fetchrow()){ $total_time = $row[9]; $allhours = $allhours + $total_time; ## Make our HTML look better if no data. $row[0] = "&nbsp;" if($row[0] eq ""); $row[1] = "&nbsp;" if($row[1] eq ""); $row[2] = "&nbsp;" if($row[2] eq ""); $row[3] = "&nbsp;" if($row[3] eq ""); $row[4] = "&nbsp;" if($row[4] eq ""); $row[6] = "&nbsp;" if($row[6] eq ""); $row[7] = "&nbsp;" if($row[7] eq ""); $row[9] = "&nbsp;" if($row[9] eq ""); $row[10] = "&nbsp;" if($row[10] eq ""); print <<HTML; <TR BGCOLOR="#FFFFFF"> <TD><FONT SIZE=2 FACE=ARIAL>$row[0]</FONT></TD> <TD><FONT SIZE=2 FACE=ARIAL>$row[1]</FONT></TD> <TD><FONT SIZE=2 FACE=ARIAL>$row[2]</FONT></TD> <TD><FONT SIZE=2 FACE=ARIAL>$row[3]:$row[4]</A></FONT></TD> <TD><FONT SIZE=2 FACE=ARIAL>$row[6]:$row[7]</FONT></TD> <TD><FONT SIZE=2 FACE=ARIAL>$row[9]</FONT></TD> <TD><FONT SIZE=2 FACE=ARIAL>$row[10]</FONT></TD> HTML } # End of while. print<<HTML; </TR><tr> <td></TD> <td></TD> <td></TD> <td></TD> <td>Total Time:</TD><td bgcolor=#FFFF99>$allhours</TD><td></TD></TR></ +TABLE></CENTER> <P> <HR WIDTH=80%> <P> <CENTER> <FONT SIZE=4> <A HREF="">Main Page</A> </FONT> </CENTER> </BODY></HTML> HTML } # End of normal_results subroutine ################ END NORMAL RESULTS SUBROUTINE


delete.cgi
#!/usr/bin/perl use CGI qw/:standard/; require "common.sub"; print header; #$oid = $ENV{QUERY_STRING}; #$sav_oid = $oid; if ($user eq "$admin"){ use CGI; my $q = new CGI; @deletes = $q->param('delete_this_row'); foreach (@deletes) { &Create_DB_Connection; &delete_results; } &print_results; $dbh->disconnect; }else{ &print_error; } ################ BEGIN DELETE RECORD SUBROUTINE sub delete_record{ $SQL="DELETE FROM timeclock WHERE oid = '$sav_oid'"; my $sth = &Do_SQL; } ################ END DELETE RECORD SUBROUTINE ################ BEGIN PRINT RESULTS SUBROUTINE sub print_results{ print <<HTML; <HTML><HEAD><TITLE>Delete Entry</TITLE></HEAD> <BODY BGCOLOR="#FFFFFF"> <CENTER><FONT SIZE=6 FACE=ARIAL>Delete Results</FONT></CENTER> <HR WIDTH=80%> <P> <CENTER> <FONT SIZE=6 FACE=ARIAL>Record Deleted!</FONT> </CENTER> <P> <HR WIDTH=80%> <P> <CENTER> <FONT SIZE=4 FACE=ARIAL> <a href="$home">Home</A> | <a href="in_form.cgi">Clock In</A> | <a href="search_form.cgi">Search</A> </FONT> </CENTER> </BODY></HTML> HTML # Release the statement handle resources $sth->finish; } # End of print_results subroutine ################ END PRINT RESULTS SUBROUTINE

In reply to Re: Re: Re: Re: Multiple Check boxes and Handling by nlafferty
in thread Multiple Check boxes and Handling by nlafferty

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.