Thanks for the reminder.  I think the reason that "print $query->redirect(-uri=>'http://www.mysite.com', -nph=>1);" is not working, is because my program doesn't seem to know how to handle "nph". I am using Apach1.3.26 and Perl 5.6.1. I have
"use CGI qw(:standard -nph) ;" at the beginning of the script. However, when I tried to use nph, the server complains about "Bad Header".
 
Is there any known issues that the versions I use don't support nph? Am I missing something?
 
Thanks.
 
Wei
----- Original Message -----
To: Wei Gao
Sent: Tuesday, November 05, 2002 3:19 PM
Subject: Re: use http-equiv to refresh the page


Any time you see an Internal Server Error, you should be looking in your
apache server's error_log file to see what exactly the error was. That will
help you (and the list) figure out what's going wrong.

Wes




"Wei Gao" <[EMAIL PROTECTED]> on 11/05/2002 06:10:34 PM

To:    "Perrin Harkins" <[EMAIL PROTECTED]>
cc:    <[EMAIL PROTECTED]>
Subject:    Re: use http-equiv to refresh the page


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 -----
  From: Perrin Harkins
  To: Wei Gao
  Cc: [EMAIL PROTECTED]
  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


(See attached file: C.htm)



Reply via email to