Thanks.
 
I have tried "print $query->redirect('http://somewhere.else/in/movie/land') ;" before, which works fine as to redirect the user to the web page. However, if the user then tries to refresh this page, the CGI script is called again without any params, which result in "Internal Server Error". So, the goal I want to achieve is that the user can refresh the page I returned without getting an error. It should refresh the web page, not calling my CGI script again.
 
I also tried "print $query->redirect(-uri=>'http://somewhere.else/in/movie/land', -nph=>1);" moments ago, which generated an "Internal Server Error" in IE window.

Is using <meta> tag a "bad" approach? I thought this is a way to solve my situation here.
 
Wei
 
----- Original Message -----
To: Wei Gao
Sent: Tuesday, November 05, 2002 2:50 PM
Subject: Re: use http-equiv to refresh the page

Wei Gao wrote:

> In my perl program executing in Apache web server, I have the
> following code:

> use CGI ;

> $query = new CGI ;
> $url = "http://www.mycite.com ;      #The url to refresh.

>  print $query->header(-status=>'200 Ok', -type=>'text/html');
>  print "<html><head><meta http-equiv=\"Refresh\"
> content=\"0;URL="$url\"" /></head></html>";


Uh, that's not a redirect; that's an ugly proprietary hack.  You should
be using standard HTTP redirects.  See
http://search.cpan.org/author/JHI/perl-5.8.0/lib/CGI.pm#GENERATING_A_REDIRECTION_HEADER
for more.

- Perrin

Reply via email to