Hi
I would like to know how to extract different input fields that are sent from the upload_form.html page to upload.cgi
I am a newbi to PERL although I know (from c programming in cgi) that I I must get the data from $string=$ENV('QUERY_STRING');
For instance I would like to read the input of the comment box;
your name:<input name="commentxy" ... but can not quite find where in upload.cgi the GETENV is passed.
kind regards
Jonas Lundberg
XUpload - input fields
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
Code: Select all
my $commentxy = $cg->param('commentxy');
Hi that is great, thanks
Just one more question if I may .. I am trying to pass the result of $commentxy to a file for instance and the script halts at this point, the code i would have to do this is
open filesp, ">$dir/test.txt" || die "cannot open file for reading: $!";
print filesp "$commentxy";
close(filesp);
but this code has a problem, probably do to with the expected data that is being printed isnt correct ?
Just one more question if I may .. I am trying to pass the result of $commentxy to a file for instance and the script halts at this point, the code i would have to do this is
open filesp, ">$dir/test.txt" || die "cannot open file for reading: $!";
print filesp "$commentxy";
close(filesp);
but this code has a problem, probably do to with the expected data that is being printed isnt correct ?
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
The code looks fine. $dir is defined?
You can add
to the code to view detailed error in browser.
PS: probably you've already fixed it
You can add
Code: Select all
use CGI::Carp qw(fatalsToBrowser);
PS: probably you've already fixed it