#!/usr/bin/perl -w # $form_data = $ENV{'QUERY_STRING'}; $form_data =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C",hex ($1))/eg; # Replace "+" sign with " "space char. $form_data =~ s/\+/ /g; # Split $form_data into name/value pairs: @fields = split (/&/, $form_data); # Init variables with form data values from following fields: # From Text Fields: ($form_name, $candidate) = split (/=/, $fields[0]); ($form_name, $position) = split (/=/, $fields[1]); # From Radio buttons: ($form_name, $education) = split (/=/, $fields[2]); ($form_name, $status) = split (/=/, $fields[3]); ($form_name, $hired) = split (/=/, $fields[4]); # From Comments Field: ($form_name, $comments) = split (/=/, $fields[5]); # Print and append file dataform.html # Heres the area I'm having problems with... # Need to inject a if then elsif statement because # if any of my fields are blank within my HTML form I need it to send # a error mesg until all fields have been inputted then I need to send # the below confirmation mesg....Can anyone show me how to correctly adjust # my script:) if (!$.....){ print "error }elsif (!$.....){ print error.. ... .. } esle # print good stuff to screen and to { open(OUT, ">> dataform.html") or die "Can't open file: $!"; print OUT "CANDIDATE: $candidate\n"; print OUT "POSITION TYPE: $position\n"; print OUT "LEVEL OF EDUCATION: $education\n"; #print OUT "STATUS OF AGREEMENT: $status\n"; #print OUT "WAS HE OR SHE HIRED?: $hired\n"; close OUT; } # Send back user confirmation: print << "END_OF_REPLY"; Content-type: text/html