Say I have two files. file1.cgi and admin.cgi . Admin.cgi has a whole bunch, over 20 and will probably become greater than 50 checkboxes that are grouped together. The admin file acts as a configuration/backbone for the other script, something that's common with admin files.

The question is, what would be the easiest way to transport the checkbox values into the other script so file1.cgi can use it? What I need to do is store which boxes are checked and pass this somehow to the file1.cgi. The admin can change these values at any time; some times s/he may have one checkbox marked, other times maybe half or all of them.

The point of this is I need to check against all these values in file.cgi. The only idea I came up with is using DB_File or SDBM and storing them in a joined string then inside file1.cgi I could split them back into variables. This seems like a tedious task and there must be an easier way.

To make this one bit harder, how can I keep the check boxes checked for the next time they log back in? I need the choices they selected to remain the same the next time they access the admin panel, so the method used to pass this to the other script must also store these in a manner I can do this.

If you need a better description, let me know and I'll try to revise it. Thank you all for your time.


In reply to Passing variables to another script (theory) by Anonymous Monk

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.