Actually, all I want is to be able to write the data, and redirect to new web page say it was done.

Doesn't your code already do that?

If you know of another way other than using param, it would be great. If not, all I need is the one field wriiten to the txt file.

The server has to be able to tell what you want to do. One option is to use a param like you did. That's very proper.

Another way is is by having multiple scripts. Specifically, script2.cgi would be the contents of if (param('S1') eq "Send") block, and script1.cgi would have the rest. script1.cgi would specify script2.cgi in the action field of the of the <form> element.

It's a question of prefence, but checking the param like you are already doing is probably the most straightforward.


In reply to Re^3: Updated Button Question by ikegami
in thread Updated Button Question by Midnite

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.