newatperl has asked for the wisdom of the Perl Monks concerning the following question:
How can I set $query->param('Action') to something?my $query = new CGI; $query->param('Action') = "nothing yet"; #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 "<h2>Cancer Genomics Online Library Addition Form</h2>\n"; if ($query->param('Action') eq 'Submit') { # we have some data print "<h2>Entry Results</h2>\n"; # check data if (&check_entry($query) == 0) { &print_success($query); &make_entry($query); } else { print "<HR><H2>Errors Found</H2>\n"; print "<P>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
Any ideas why?sub make_entry { my($query) = @_; my $PUBFILE = "temp.html"; open PUBFILE, ">$PUBFILE"; select STDOUT; my $pubtitle = $query->param('pubtitle'); my $pubauthor = $query->param('pubauthor'); my $pubdate = $query->param('pubdate'); my $pubjournal = $query->param('pubjournal'); my $pubcategory = $query->param('pubcategory'); my $puburl = $query->param('puburl'); my $pubkey1 = $query->param('pubkey1'); my $pubkey2 = $query->param('pubkey2'); my $pubkey3 = $query->param('pubkey3'); my $pubkey4 = $query->param('pubkey4'); my $pubcomments = $query->param('pubcomments'); #my $pubupload my $yourname = $query->param('yourname'); my $youremail = $query->param('youremail'); my $yourphone = $query->param('yourphone'); print PUBFILE <<END; <!-- \n $pubtitle \n $pubauthor \n $pubcategory \n $pubkey1 &amp;amp;amp;nbsp $pubkey2 &amp;amp;amp;nbsp & +;amp;amp;amp;pubkey3 &amp;amp;amp;nbsp \n --> \n <table>\n <tr><td>Title: </td><td>$pubtitle</td><tr>\n <tr><td>Author: </td><td>$pubauthor</td><tr>\n <tr><td>Publish Date: </td><td>$pubdate</td><tr>\n <tr><td>Journal: </td><td>$pubjournal</td><tr>\n <tr><td>Category: </td><td>$pubcategory</td><tr>\n <tr><td>URL: </td><td><a href="$puburl">$puburl</a></td><tr>\n <tr><td>Keywords: </td><td>$pubkey1   $pubkey2   $pubk +ey3   $pubkey4</td><tr>\n <tr><td>Comments: </td><td>$pubcomments</td><tr>\n <tr><td>Posted: </td><td></td><tr>\n </table> <table> <tr><td>Name of Poster: </td><td>$yourname</td><tr>\n <tr><td>Email of Poster: </td><td>$youremail</td><tr>\n <tr><td>Daytime Phone of Poster: </td>$yourphone<td></td><tr>\ +n </table> END close PUBFILE; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: using strict; lots more errors
by jeffa (Bishop) on May 10, 2001 at 09:18 UTC | |
by buckaduck (Chaplain) on May 10, 2001 at 19:49 UTC | |
by jeffa (Bishop) on May 10, 2001 at 21:39 UTC | |
|
(arturo) Re setting default values
by arturo (Vicar) on May 10, 2001 at 17:50 UTC | |
|
Re: using strict; lots more errors
by diarmuid (Beadle) on May 10, 2001 at 18:50 UTC |