Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Redirect to another web page using CGI ?

Reply
Thread Tools

Redirect to another web page using CGI ?

 
 
vivekian
Guest
Posts: n/a
 
      03-08-2007
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.

 
Reply With Quote
 
 
 
 
Mumia W.
Guest
Posts: n/a
 
      03-08-2007
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."

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling another cgi program using CGI.pm dmedhora@gmail.com Perl Misc 12 08-28-2006 01:00 AM
Using a Link Button to redirect to another page by using data from =?Utf-8?B?R1REcml2ZXI=?= ASP .Net 1 02-16-2005 07:04 PM
accessing the web user control's control from a web page and set a value from another web page Reny J Joseph Thuthikattu ASP .Net 1 12-30-2004 12:21 PM
Basic Q - Response.Redirect, all redirect to first Response.Redirect statement Sal ASP .Net Web Controls 1 05-15-2004 03:46 PM
CGI Redirect to another page Andrew Chalk Python 11 09-25-2003 09:24 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57