Simply put, you can't make the scenario you outlined work as you expressed it. See cbrandtbuffalo's reply above for one reason why.

Here's another (also with caveat that you might be able to do something (extremely risky) with jscript): the
<INPUT TYPE="file" NAME="data2">
determines what your (server-side) script expects AND uses.

And are you really hopeing to upload to TWO different sites, "processdata1.com" and "processdata2.com" from a single script? To me, that suggests MASSIVE security gaps, among other, more mundane problems.

Using two forms can be tricky and can certainly provide more opportunities for user_errors. Nonetheless, it may still be more nearly foolproof than asking users to (correctly) provide a filename in a (text) input or via radiobutton or whatever, and then matching that (possibly garbled) data against what you think you want processed by which script...after which you'll still have to untaint the data in the file before you let it get anywhere near the system.

Update ...to say that I will try to make last para easier to read as soon as I relocate/reconnect language centers in brain. Sorry. That's almost as hard to grok as OP's statement of problem


In reply to Re: form cgi by ww
in thread form cgi 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.