----- Original Message ----- From: "Augusto Flavio" <[EMAIL PROTECTED]>
To: "'Perl Beginners - CGI List'" <beginners-cgi@perl.org>
Sent: Tuesday, April 11, 2006 8:05 AM
Subject: redirect - CGI


Hi,


I'm looking for a method to redirect the url of browser to elsewhere. What i do was check the documentation of CGI.pm:

"Sometimes you don't want to produce a document yourself, but simply redirect the browser elsewhere, perhaps choosing a URL based on the time of day or the identity of the user. The redirect() function redirects the browser to a different URL. If you use redirection like this, you should not print out a header as well. You should always use full URLs (including the http: or ftp: part) in redirection requests. Relative URLs will not work correctly."

Well, then i produced a code like this:

#!/usr/bin/perl
use CGI qw/:standard/;
print "Content-type: text/html\n\n";

print redirect('http://www.yahoo.com');


But didn't work. Why? I always get this msg on browser:

Status: 302 Moved Location: http://www.yahoo.com



How i do it?


Try print redirect(-location=>"http://www.yahoo.com";);

Mickalo

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to