whats up everybody? havent been on daniweb in a while. self-motivation like whut....until now. anyways ive got this script that makes an html form with 19 or so fields. its supposed to put the form info into a file (mediaRequest_log.txt). it gets this information by way of
# get form info from POST method
read(STDIN, $text, $ENV{'CONTENT_LENGTH'});
my @value_pairs = split (/&/,$text);
my %form_results = ();
foreach $pair (@value_pairs) {
($key, $value) = split (/=/,$pair);
$value =~ tr/+/ /;
$value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;
$form_results{$key} = $value; # store the key in the results hash
}
and then to put it into a variable and append it to a file
foreach $key (sort keys(%form_results)) {
# print "$key has value $form_results{$key}<BR>\n";
# $mail_string .= "$key = $form_results{$key}\n";
$file_string .= "$form_results{$key}|";
}
chop($file_string);
# add newline to end of $file_string
$file_string .= "\n";
$filename = "mediaRequest_log.txt";
open(DAT,">>$filename") || die("Cannot Open File");
print DAT "$file_string";
close(DAT);
now i also use this
use CGI;
$query = new CGI;
to format the form element values for a email string ($mail_string) and a display string to display the results when the submit button is clicked ($display_string). long story short, this script works fine except that it does not write anything to the file except for a blank line. why is this happeneing???? can i not use both methods together? if thats not so, how can i fix my script to make it write the form element values to the text file? your help is greatly appreciated.