[ back to toc ]

cnnot write file using the value submitted by form in html

Date: 2002/04/03 09:58

I parsed html input and then using the value( $input{'ORDER ID'}) write
it doesn't show error message(can't open file), olnly do not excute rest
of code after open(....)

please loot at follwing code
#$action = input{'ACTION'};
if ((uc substr($action,0,3) eq 'ADD'))
print "$input{'ITEM CODE'} |";
print "$input{'ORDER ID'} |";
print "$input{'ITEM NAME'} |";
print "$input{'QTY'} ";

### if i use this, cannot write to a file
$test = $input{'ORDER ID'};

### if i assign file name myself, it work.
# $test = '1234567';

open(OUTF, ">>$order_file_name/$test") || &err_trap("Cannot open
e_name for writing\n");

I would recommend that you do not use CGI input variables with names
having space in it. Regarding the file opening issue, I see no reason for
the code not opening the file, the error should be somwhere else in the


[ back to toc ]