#!/usr/bin/perl -w #entry.cgi use CGI qw/:standard/; use FileHandle; print header, start_html('Title goes here');#feel free to change this if (!param) { print h1('header goes here'), start_form(-action=>""), "Enter name here", textfield('name')," i.e. andy selby", p(), "Enter your email addy if different from your name", textfield +('email'),"\@youremailaddress.com", p(), "Monday",popup_menu(-name=>'monday', -values=>['yes','no','probably','preferred']),#feel free to su +ggest more p(), "Tuesday",popup_menu(-name=>'tuesday', -values=>['yes','no','probably','preferred']), p(), "Wednesday",popup_menu(-name=>'wednesday', -values=>['yes','no','probably','preferred']), p(), "Thursday",popup_menu(-name=>'thursday', -values=>['yes','no','probably','preferred']), p(), "Friday",popup_menu(-name=>'friday', -values=>['yes','no','probably','preferred']), p(), "Saturday",popup_menu(-name=>'saturday', -values=>['yes','no','probably','preferred']), p(), "Sunday",popup_menu(-name=>'sunday', -values=>['yes','no','probably','preferred']), p(), submit, end_form; }else{ open (OUT, ">>availability.csv") or die "$!";#output to csv file print OUT join ",", map { param($_) } qw/name email monday tuesday wed +nesday thursday friday saturday sunday/; print OUT "\n"; p(), close OUT; } print "<a href=\"display.cgi\">click here to view results</a>";#redire +ct doesn't work, keeps 302'ing print end_html; #################################################### #!/usr/bin/perl -w #display.cgi use strict; use warnings; use CGI qw/:standard :html3/; print header; print start_html('title goes here');#feel free to change this title print h1('header goes here'); print CGI::start_table(); print caption('The Following people are available thus'), print TR({}, th([ 'Name', 'Email', 'Monday', 'Tuesday', 'Wednesday', 'Thursday','Friday', 'Saturday', 'Sunday' ]), ); open(my $DOC, "<", "availability.csv") or die "$!"; while(<$DOC>) { chomp; my @fields = split /\s*,\s*/; print TR({}, td([ $fields[0], $fields[1], $fields[2], $fields[3], $fie +lds[4], $fields[5], $fields[6], $fields[7], $fields[8] ]), ); } close $DOC; print CGI::end_table(); print end_html();

In reply to member availability entry and display script by andyselby

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.