it is supposed to be able to read in multiple orders and then output all of them. So far, I can only do one order at a time, and I'm not sure how to make it do multiple orders.
You need to store the order data someplace between page calls. Here are some of the standard techniques that are used with web applications:
  1. Store the data in a database (like mysql, sqlite, Oracle, etc.)
  2. Store the data in a file on the server.
  3. Store the data as client cookies.
  4. Store the data as form variables which get continually passed between the pages.
The basic idea is that your CGI script will consult the datastore (whichever one you decide to use) for the old order data, add the new order data passed in via form variables and then store everything back out to the datastore so it's ready for the next call to the CGI script.

Since this looks like a class assignment, you might see if the instructor has given any indication of a preferred way to do this. For instance, if this is an intro web programming class, I doubt you will be expected to learn how to interact with a database since that would take up a lot of time that could be used to introduce a lot of other concepts. On the other hand, if the class has already covered how to interact with databases, perhaps that's the approach you should pursue.


In reply to Re: CGI script help by pc88mxer
in thread CGI script help by negzero7

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.