#!/usr/local/bin/perl -w use strict; use CGI qw(:standard); # Include standard HTML and CGI +functions use CGI::Carp qw(fatalsToBrowser); # Send error messages to b +rowser my @foodmenu = ['Pizza','Garlic Bread','Apple Pie','Ice Cream']; &printheader; if (param()) { &displayorder; } &printform(@foodmenu); &printtail; sub printheader { print header(), start_html(-title=>"Pizza Order Form", -bgcolor=>"#00CCFF"), h1("Mikey's Pizza Delivery Service"), hr; } sub printtail { print address("pizzaman\@pizza.co.uk"), end_html(); } sub printform { my $foodchoices = $_[0]; print h1("Order your food here"), start_form(), "What's your name? ", textfield("name"), p, "What's your phone? ", textfield("phone"), p, "Food order? ", checkbox_group(-name=>'food', -values=>\@$foodchoices, -columns=>2, -multiple=>'true'), p, submit("Submit form"), reset("Clear form"), end_form(); } sub displayorder { print h1("You have ordered..."); print "<UL>"; foreach my $key (param) { my @values = param($key); print "<LI><B>$key:</B> "; print join(", ",@values),"</LI>\n"; } print "</UL><HR>"; }

gives me this error message / Software error: Malformed multipart POST

Hello fellow monks, I'm trying to submit 1 or multiple values to be shown in displayorder subroutine

I also tried setting values from food array in printform subroutine directly but still getting error above. However, my preference is the array solution from within printform sub as stated in code presently because I'm getting lots of values where I need to provide checkboxes for user selection choices. Any help is greatly appreciated, thanks


In reply to Perl CGI checkbox_group submit error by begood321

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.