Hello Perl Monks;

I am trying to create a .pl script that processes data via "GET" from a HTML form and appends the info to a seperate .html file.The contents I need to append is the result I get on the URL command line after submitting 3 data field entrys;ie URL command line example:

http://firm.com/cgi-bin/inter.pl?candidate=Juan+Amore&position=Technic +ian&education=Professional+Certification&RESULT_FileUpload-7=&RESULT_ +TextArea-8=&Submit=Submit

My perl code is the following which is what I'm trying to use to clean up the + and & signs which are associated on the above URL command submission and trying to clean it up a bit and have it displayed via a HTML format

</CODE>
#!/usr/bin/perl -w # Copy form data from the environment variable $form_data = $ENV{'QUERY_STRING'}; $form_data =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C",hex ($1))/eg; # Replace the + char with space char. $form_data =~ s/\+/ /g; # Split $form_data into name/value pairs @fields = split (/&/, $form_data); # Init script variables with form data values # $form_name is the name from the form. # from the text fields... ($form_name, $candidate) = split (/=/, $fields[0]); ($form_name, $position) = split (/=/, $fields[1]); ($form_name, $education) = split (/=/, $fields[2]); $form_name > dataform.html # Send back to the user a confirmation. print << "END_OF_REPLY"; <Content-type: text/html> END_OF_REPLY <HTML> <HEAD> <TITLE>Confirmation Mesg</TITLE> </HEAD> <BODY> <P><FONT SIZE=5>Thanks $first! We'll send you your: $status.</FONT></P> </BODY> </HTML> END_OF_REPLY
Below is my HTML form which I'm using to create a CGI script for it to send that URL command line data to STDOUT via a HTML file. Is there also a way of letting a user know via a HTML Notice of confirmation if all three field areas;ie candidate,position & education have been entered and if one is left blank to respond back and tell user that theres an error,...please fill in field. Any HELP is MOST Appreciated!!:)
<HTML> <FORM ACTION="/cgi-bin/inter.pl" METHOD="GET"> <B>Candiate Name</B> <INPUT TYPE="TEXT" NAME="candidate" SIZE="25" MAXLENGTH="25"> <B>Position Applied For</B> <INPUT TYPE="TEXT" NAME="position" SIZE="25" MAXLENGTH="25"> <B>Education Level</B> <!--DROP_DOWN_TYPE --><SELECT NAME="education"> <OPTION></OPTION> <!--DROP_DOWN_TYPE NAME="education" VALUE="Radio-0" --><OPTION> High S +chool</OPTION> <!--DROP_DOWN_TYPE NAME="education" VALUE="Radio-1" --><OPTION> Vocati +onal Degree</OPTION> <!--DROP_DOWN_TYPE NAME="education" VALUE="Radio-2" --><OPTION> Associ +ates Degree</OPTION> <!--DROP_DOWN_TYPE NAME="education" VALUE="Radio-3" --><OPTION> Bachel +ors Degree</OPTION> <!--DROP_DOWN_TYPE NAME="education" VALUE="Radio-4" --><OPTION> Master +s Degree</OPTION> <!--DROP_DOWN_TYPE NAME="education" VALUE="Radio-5" --><OPTION> Doctor +al Degree</OPTION> <!--DROP_DOWN_TYPE NAME="education" VALUE="Radio-6" --><OPTION> Post-D +octoral Studies</OPTION> <!--DROP_DOWN_TYPE NAME="education" VALUE="Radio-7" --><OPTION> Profes +sional Certification</OPTION> </SELECT>

In reply to Trying to write a CGI script for this piece of HTML by villa

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.