Redirect to another web page using CGI ?

V

vivekian

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

Mumia W.

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top