I'm going to assume that you are already using CGI, as you mention @items = param("item");. I don't know anything about PHP, so this may be a reference to a PHP function of the same (fairly obvious)name.

Anyway, going ahead with my assumption, if you are using CGI already, and the above quoted line doesn't work, then there is something wrong as (from perlman:lib:CGI)

FETCHING THE VALUE OR VALUES OF A SINGLE NAMED PARAMETER: @values = $query->param('foo'); -or- $value = $query->param('foo'); Pass the param() method a single argument to fetch the value of the na +med parameter. If the parameter is multivalued (e.g. from multiple se +lections in a scrolling list), you can ask to receive an array. Other +wise the method will return a single value. If a value is not given in the query string, as in the queries ``name1 +=&name2='' or ``name1&name2'', it will be returned as an empty string +. This feature is new in 2.63.

If this is the case, you should post a larger section of your code and possibly the html it is processing (don't forget your <CODE></CODE> tags and possibly <READMORE></READMORE> tags) and the girls and guys here will have a better chance at being able to help you.


In reply to Re: Input arrays to CGI by BrowserUk
in thread Input arrays to CGI by Nightblade

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.