#!/util/bin/perl ########################################################################### use CGI qw/:standard :html3 param/;; use CGI::Carp qw(fatalsToBrowser carpout); BEGIN{ print "Content-type: text/html\n\n"; open(STDERR, ">&STDOUT"); $| = 1; print ''; } ######################### #Beginning of Javascript ######################### #$JSCRIPT=<"); # } # else # { # document.write(""); # } # function moveover(txt) # { # window.status = txt; # } # #JSEND # #; #End of Javascript ############################################################################ #NEW CGI OBJECT my $query = new CGI; #PRINT HEADER print $query->header; print $query->start_html( -title=>'Add to the Cancer Genomics Online Library'); # -script=>$JSCRIPT); #PRINT TITLE &print_title; #PRINT FORM print "

Cancer Genomics Online Library Addition Form

\n"; if ($query->param('Action') eq 'Submit') { # we have some data print "

Entry Results

\n"; # check data if (&check_entry($query) == 0) { &print_success($query); &make_entry($query); } else { print "

Errors Found

\n"; print "

Please correct the errors above on the form below.\n"; &print_form($query); } } else { &print_intro; &print_form($query); } &print_tail; print $query->end_html; #End of Program ################################################################################# sub print_title { print "\n"; print "\n"; print "

menubar will go here.

\n"; } sub print_intro { print"

Welcome to Cancer Genomics Online Library Addition Form.\n"; print"

Please fill in all relevant information.\n"; } sub print_form { my($query) = @_; my $width = 50; print $query->start_multipart_form; print "

Your Information

"; print "\n"; print "\n"; print "\n"; print "\n"; print"
Your Name:"; print $query->textfield( -name=>'yourname', -size=>$width); print "
Your E-mail Address:"; print $query->textfield( -name=>'youremail', -size=>$width); print "
Your Daytime Phone:   "; print $query->textfield( -name=>'yourphone', -size=>15); print "
\n"; print "

Entry Information

"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print"
Publication Title:"; print $query->textfield( -name=>'pubtitle', -size=>$width); print "
Publication Author:"; print $query->textfield( -name=>'pubauthor', -size=>$width); print "
Date of Publication:"; print $query->textfield( -name=>'pubdate', -size=>$width); print "
Journal of Publication:"; print $query->textfield( -name=>'pubjournal', -size=>$width); print "
Online URL:"; print $query->textfield( -name=>'puburl', -size=>$width); print "
Category:"; print $query->popup_menu( -name=>'pubcategory', -values=>['Choose a Category','Genetics','Mice','DNA', 'None of the above'], -default=>'None', -labels=>\%labels); print "
Relevant Keywords:"; print $query->textfield(-name=>'pubkey1',-size=>(($width/4)-1)); print "  "; print $query->textfield(-name=>'pubkey2',-size=>(($width/4)-1)); print "  "; print $query->textfield(-name=>'pubkey3',-size=>(($width/4)-1)); print "  "; print $query->textfield(-name=>'pubkey4',-size=>(($width/4)-2)); print "
Additional Comments:"; print $query->textarea( -name=>'pubcomments', -default=>'Add additional comments here.', -rows=>2, -columns=>($width-2)); print "
Upload a copy: "; print $query->filefield( -name=>'pubupload', -default=>'', -size=>($width-14), -maxlength=>100); print "
\n"; print $query->submit('Action','Submit'); print " \n"; print $query->reset; print $query->endform; } sub subscribe_to_list { my($query) = @_; } sub print_success { print < Your addition to the Cancer Genomics Online Library has been successfully submitted.

Any Online Library Questions should go to   tamayo\@genome.wi.mit.edu.

Any questions regarding the web site should go to   zhao\@mit.edu.

Back to Cancer Genomics Home EOM } sub check_entry { my($query) = @_; my($bad); $bad = 0; if ($query->param('yourname') !~ /\S+/) { $bad = 1; print "

Error: Your Name field is blank\n"; } if ($query->param('youremail') !~ /\S+/) { $bad = 1; print "

Error: E-mail field is blank\n"; } if ($query->param('youremail') !~ /\@/) { $bad = 1; print "

Error: E-mail field doesn't have \@ sign.\n"; } if ($query->param('pubtitle') !~ /\S+/) { $bad = 1; print "

Error: Publication Title field is blank.\n"; } if ($query->param('pubauthor') !~ /\S+/) { $bad = 1; print "

Error: Publication Author field is blank.\n"; } #if ($query->param('phone') !~ /\S+/) { # $bad = 1; # print "

Error: Phone field is blank\n"; #} $bad; # return whether or not entry is good } sub make_entry { my($query) = @_; } sub print_tail { print <


Dacheng Zhao
Last Edited:
Contact the Webmaster at zhao\@mit.edu with questions or comments
END }