if this post is easy to read so is to reply !!!

i have a html file with uploads a file and sends the username to a .cgi file using post method.

the part of code in the cgi file is as below. i am able to get the filename but not able to get the username thats getting posted to the file how to know the value of username. i am trying to store the username in the variable pxuser but when i print its value is blank. can somebody help username is coming in as p_user from the html file

foreach $key (sort {$a <=> $b} $query->param()) {
# rearrange:
next if ($query->param($key) =~ /^\s*$/);
next if ($key !~ /^filetoupload_(\d+)$/);

# next condition is a subset of the previous condition
# i.e., $key cannot be empty AND match filetoupload_\d+
#next if ($key =~ /^\s*$/);

$Number = $1;

# only one matching group: ( ) 
if ($query->param($key) =~ /([^\/\\]+)$/) {
$Filename = $1;
$Filename =~ s/^\.+//;

# hence, no $2
#$pxuser = $2;
#$pxuser =~ s/^\.+//;

$files{$Number} = $Filename;
$File_Handle = $query->param($key);

if (!$ALLOW_INDEX && $Filename =~ /^index/i) {
print header;

Please follow forum rules...

  1. No duplicate post is tolerated (http://www.unix.com/shell-programming-scripting/170261-y-username-always-empty.html\)
  2. Use code tags
  3. Have better post titles

I am NO CGI expert, so can't help you...
btw... where is the code for pxuser?... its commented here... looks like coming from inputs... $2?

--ahamed

that's what i am asking what to write to get username hope u can read my initial post