in reply to Perl CGI redirect
The variables you give after the ? are usually send as %ENV variables. Why not try to print them all and see if your webserver is like that?
#!/usr/local/bin/perl print "Content-type: text/html\n\n"; print "<pre>\n"; foreach $key (sort keys(%ENV)) { print "$key = $ENV{$key}<br/>"; } print "</pre>\n";
Now, you seem to want to use CGI, in that case, you get them in param, and you can iterate over them, as described in this previous post:
Best way to parse CGI params
You can then use:
my $q = new CGI; if ($q->param("URL")) { ... }
There is also something called Tainted mode, which you should use once your testcode is working, because what If the string after the ? is 2Mb big? or an invalid url etc.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl CGI redirect
by Anonymous Monk on May 26, 2015 at 15:12 UTC | |
|
Re^2: Perl CGI redirect
by jbt424 (Initiate) on May 26, 2015 at 16:32 UTC | |
by FreeBeerReekingMonk (Deacon) on May 28, 2015 at 21:15 UTC | |
by FreeBeerReekingMonk (Deacon) on May 28, 2015 at 21:54 UTC |