> my $q = new CGI;
> ##############################
> # Get the input
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> 
> # Split the name-value pairs
> @pairs = split(/&/, $buffer);
> 
> foreach $pair (@pairs) {
>    ($name, $value) = split(/=/, $pair);
> 
>    $value =~ tr/+/ /;
>    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>    $value =~ s/<([^>]|\n)*>//g;
>    $value =~ s/<//g;
>    $value =~ s/>//g;
>    $FORM{$name} = $value; #line 21
> }
>  $url = $FORM{'url'};   #line 23

Are you comfortable enough with Perl to know what all of those lines do?
Since you are already using the CGI module, why not let that do all the
work for you in these two lines:

 use CGI qw/:standard/;
 my $url = param('url');

> #THIS OPENS THE HTML FILE
> 
> use LWP;
> my $pagecontent;
> 
> my $ua = LWP::UserAgent->new;
> my $request = HTTP::Request->new('GET', $url);
> my $response = $ua->request($request);
> 
> if ( $response->is_success()){
>   $pagecontent = $response->content() ;
> }else {
>   my $rc = $response->code();
>   die "Error Occured with response code $rc";
> }

LWP::Simple might make things easier too.

What happens when someone submits the form with the form variable 'url'
set to:

 file://c:/password.txt
 file://d:/network_drive/secret.txt
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to