On Fri, 14 Nov 2003 00:17:29 -0600, Andrew Gaffney wrote:
>> In my cgi script I want to open some site let us suppose
>> http://www.google.com

> use CGI;
> 
> my $cgi = new CGI;
> print $cgi->header;
> print "<script>location.href = 'http://www.google.com';</script>
> 
> There is a more correct way to do this using HTTP codes, such as:
> 
> print "HTTP/1.0 302 Found\n";
> print "Location: www.google.com\n\n";

Not quite "right" CGI.pm-wise, as the CGI module _has_ a redirect()
function;

  use CGI;

  my $cgi = CGI->new();
  print $cgi->redirect( 'http://www.google.com/' );

More information:

  perldoc CGI


-- 
Tore Aursand <[EMAIL PROTECTED]>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to