sushrut
asked on
implement JSP response.sendRedirect() in perl
How can I implment JSP response.sendRedirect() in perl cgi in Netscape fastrack server in perl 5.005_03 built for aix.
What is the exact process/data (At low level) that goes on between two application servers. ?
I want to redirect a request from AIX-Netscape Fastrack server to NT-ASP page.
What is the exact process/data (At low level) that goes on between two application servers. ?
I want to redirect a request from AIX-Netscape Fastrack server to NT-ASP page.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
so does code above
sushrut,
Try this:
---------------- redirect.pl ----------------------
#!/usr/bin/perl
use CGI;
my $q = new CGI;
my $url = "http://www.somedefaultsite.com";
$url = $q->param('url') if(defined $q->param('url'));
print $q->redirect($url);
-------------------------- ---------- ---------- -----
You can use the above script for redirecting to any url/webpage by passing the target as parameter to the script. If u call the script as :
http://ww.somesite.com/cgi-bin/redirect.pl?url=http://www.abc.com
the above will redirect to www.abc.com ,
if no url is specified it will redirect to the default mentioned in the script (i.e www.somedefaultsite.com)
hope the above helps.
Aman
:-)
Try this:
---------------- redirect.pl ----------------------
#!/usr/bin/perl
use CGI;
my $q = new CGI;
my $url = "http://www.somedefaultsite.com";
$url = $q->param('url') if(defined $q->param('url'));
print $q->redirect($url);
--------------------------
You can use the above script for redirecting to any url/webpage by passing the target as parameter to the script. If u call the script as :
http://ww.somesite.com/cgi-bin/redirect.pl?url=http://www.abc.com
the above will redirect to www.abc.com ,
if no url is specified it will redirect to the default mentioned in the script (i.e www.somedefaultsite.com)
hope the above helps.
Aman
:-)
The following would redirect the browser to yahoo.
example.pl
------------
#!/usr/bin/perl
print "Location: http://www.yahoo.com\n\n";