Redirect to another web page using CGI ?

Discussion in 'Perl Misc' started by vivekian, Mar 8, 2007.

  1. vivekian

    vivekian Guest

    Hi,

    This is a small authentication cgi perl script which makes use of
    CGI.pm.

    #!/usr/bin/perl

    use strict;
    use CGI;

    my $q = new CGI;

    my $username = $q -> param ('username') ;
    my $password = $q -> param ('password') ;

    if ($username eq "guest")
    {
    if ($password eq "guest")
    {
    #Not sure what comes here
    }
    }

    else
    {
    print $q->header( "text/plain" );
    print "Authorization Failed"
    }

    If the authentication succeeds would like to redirect to another page
    in directory say foo.html. How can this be done ? Also is there an
    authentication function which allready exists in CGI.pm ?

    Thanks in advance,
    vivekian.
     
    vivekian, Mar 8, 2007
    #1
    1. Advertisements

  2. vivekian

    Mumia W. Guest

    On 03/07/2007 08:09 PM, vivekian wrote:
    > Hi,
    > [...]


    Hello

    >
    > If the authentication succeeds would like to redirect to another page
    > in directory say foo.html. [...]


    Read the documentation for CGI.pm--particularly the section titled
    "Generating a Redirection Header."
     
    Mumia W., Mar 8, 2007
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. NWx
    Replies:
    3
    Views:
    614
  2. Reny J Joseph Thuthikattu
    Replies:
    1
    Views:
    818
    =?Utf-8?B?UHJha2FzaC5ORVQ=?=
    Dec 30, 2004
  3. =?Utf-8?B?R1REcml2ZXI=?=
    Replies:
    1
    Views:
    4,054
    Karl Seguin
    Feb 16, 2005
  4. Andrew Chalk

    CGI Redirect to another page

    Andrew Chalk, Sep 24, 2003, in forum: Python
    Replies:
    11
    Views:
    15,089
    Andrew Clover
    Sep 25, 2003
  5. LarsenMTL
    Replies:
    4
    Views:
    1,119
    Eric Walstad
    Nov 4, 2004
  6. varmansk
    Replies:
    0
    Views:
    640
    varmansk
    Nov 30, 2008
  7. Sal
    Replies:
    1
    Views:
    1,670
  8. Replies:
    12
    Views:
    610
    alpha_beta_release
    Aug 28, 2006
Loading...