Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,
I have a doubt.
As soon as user clicks on login button, he should get another web page, wher he can work.
How to go to another web page from the Login page, using $cgi->redirect method.
is there any other way to display the other page?
pls. help me in this regard. Its very urgent.
Thankq in advance.

Replies are listed 'Best First'.
Re: Displaying another web page
by leira (Monk) on Apr 20, 2004 at 16:13 UTC
    This is a little difficult to answer without knowing what sort of authentication system you're using, and without seeing code that shows what you've tried so far. Can you give us some more information, and show us what you've done so far?

    Have you already read the documentation for CGI.pm? What are you having trouble with, exactly?

    Linda

      Linda,
      It is staying in the same page and displaying the message as
      Status: 302 Moved Set-Cookie: CGISESSID=09db3b13daece8f8b6721668a03707 +02; path=/ Date: Tue, 20 Apr 2004 16:40:48 GMT location: http://local +host/reports.pl
      Hi Linda,
      Thnk you for fast response.
      Im using CGI::Session module.
      I have written print $cgi->redirect(-uri=>"http://localhost/reports.pl",-cookie=>$cookie)
      $cookie points to teh session variable which im initializing in the beginning of the program.
      now, as soon as user presses "login" button, my perl script has to show "reports.pl" page and should display the values stored in session variable.
      this is what i need actually.
      But, it is not going to reports.pl page.It remains in the same page.
      Pls help me Linda.
        When printing a redirect you need to make sure that is the only thing you are printing. Don't print a header before that.

        ___________
        Eric Hodges