[ back to toc ]

cnnot write file using the value submitted by form in html

Date: 2002/04/03 09:58

Q:
I parsed html input and then using the value( $input{'ORDER ID'}) write
file.
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
$order_fil
e_name for writing\n");

A:
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
code.

Regards,
Peter

[ back to toc ]