How do I modify this code:
Code: Select all
### Sending data with POST request if need
my $url_post = $c->{url_post} || $ENV{HTTP_REFERER};
if($url_post)
{
   if($url_post=~/\.htm(l|)$/i)
   {
      print"Content-type: text/html\n\n";
      print"<HTML><HEAD><Script>parent.document.location='$url_post'</Script></HEAD></HTML>";
      exit;
   }
   if($ENV{QUERY_STRING}!~/js_on=1/)
   {
     $url_post.='?';
     $url_post.="\&$_->{name}=$_->{value}" for @har;
     print $cg->redirect( $url_post );
     exit;
   }
   print"Content-type: text/html\n\n";
   print"<HTML><BODY><Form name='F1' action='$url_post' target='_parent' method='POST'>";
   for my $f (@files)
   {
       my @file_fields = qw(field_name file_name file_name_orig);
       print"<textarea name='$_'>$f->{$_}</textarea>" for @file_fields;
   }
   print"<textarea name='$_->{name}'>$_->{value}</textarea>" for @har;
   print"</Form><Script>document.location='javascript:false';document.F1.submit();</Script></BODY></HTML>";
   exit;
}
print"Content-type: text/html\n\n";
print"Upload complete.";
exit;
Code: Select all
name="field_name" value="file_0"
name="file_name" value="about_filming2.jpg"
name="file_name_orig" value="about_filming.jpg"
name="field_name" value="file_1"
name="file_name" value="about_rental2.jpg"
name="file_name_orig" value="about_rental.jpg"
name="field_name" value="file_2"
name="file_name" value="ahmanson6.jpg"
name="file_name_orig" value="ahmanson.jpg"
Code: Select all
name="file_0_field_name" value="file_0"
name="file_0_file_name" value="about_filming2.jpg"
name="file_0_file_name_orig" value="about_filming.jpg"
name="file_1_field_name" value="file_1"
name="file_1_file_name" value="about_rental2.jpg"
name="file_1_file_name_orig" value="about_rental.jpg"
name="file_2_field_name" value="file_2"
name="file_2_file_name" value="ahmanson6.jpg"
name="file_2_file_name_orig" value="ahmanson.jpg"
Any help is greatly appreciated.
-Brian


 Facebook
 Facebook Twitter
 Twitter