Greetings again wizards of the web,

I have just migrated all of my forms over to use the CGI lib. Several of them work in the following manner: form 'A' -> script 'B' onclick list element -> form 'C'.

For clarification hers is an example. Search for all servers in Texas (form A) yields 30 servers in a list (script B). When one of these servers is clicked form C is displayed which shows the selected server information which can be edited by an admin.

Now the problem. Form C will have defaults for most all fields that are not in use. This means that in order to populate the form elements with the values from my SQL table, I need to pass them through CGI headers. That would not be a problem if I weren't using tab functions that allow users to navigate back and forth from one site to another.

I noticed that I can use the unescape() utility in the following fashion:
$ENV{QUERY_STRING}=unescape($ENV{QUERY_STRING});  #--Needed for form element population.
This actual populates the elements with the correct value when the invoking script escapes a URL string to allow for textarea formatting.

First question: How many thousands of things can go wrong by altering $ENV{QUERY_STRING}?

Second Question: If it is okay to use the above statement then I can effectively populate the form elements by creating a string from my table query and setting it to $ENV{QUERY_STRING}. Otherwise Is there a function in the CGI lib that I overlooked that accommodates both element default values and element values?

In reply to CGI lib question by hok_si_la

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.