in reply to Re: URL redirection
in thread URL redirection

Sorry for insufficient infomation.
my $username=$cgi->param('username'); if ($username eq 'testuser'){ print $cgi->redirect("http://navitwiki/cgi-bin/main.cgi"); }else{ $message='Please Check the Username & Password'; &init_screen(); }


this is my code. While running only the following text is displayed . but i want to open the mentioned script in the browser .
URL Status: 302 Moved Location: http://navitwiki/cgi-bin/main.cgi

Replies are listed 'Best First'.
Re^3: URL redirection
by Corion (Patriarch) on Oct 22, 2007 at 09:31 UTC

    So, the most likely cause is that you or your script output something else before the redirect is printed, because, as you see in the output, the Location: header is there. Run your script on the command line to see what it outputs, or use the GET command from LWP to see what your script outputs:

    GET -USe http://...

    ... or alternatively, debug what is output via telnet.