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. Advertising

  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. Advertising

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. =?Utf-8?B?R1REcml2ZXI=?=
    Replies:
    1
    Views:
    3,825
    Karl Seguin
    Feb 16, 2005
  2. Andrew Chalk

    CGI Redirect to another page

    Andrew Chalk, Sep 24, 2003, in forum: Python
    Replies:
    11
    Views:
    14,378
    Andrew Clover
    Sep 25, 2003
  3. LarsenMTL
    Replies:
    4
    Views:
    752
    Eric Walstad
    Nov 4, 2004
  4. Sal
    Replies:
    1
    Views:
    533
  5. Replies:
    12
    Views:
    385
    alpha_beta_release
    Aug 28, 2006
Loading...

Share This Page