Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] [#2] cgi progressive displaying script ?

Expand Messages
  • Mike Payne
    Redirects don t work if you ve finished the HTTP headers, try printing this to the browser: -Mike
    Message 1 of 14 , Mar 9, 2002
    • 0 Attachment
      Redirects don't work if you've finished the HTTP headers, try printing this
      to the browser:

      <meta http-equiv="refresh" content="0;http://www.yahoo.com/">


      -Mike Payne
      -----Original Message-----
      From: Franki [mailto:frankieh@...]
      Sent: Monday, March 04, 2002 10:14 AM
      To: perl-beginner@yahoogroups.com
      Subject: RE: [PBML] [#2] cgi progressive displaying script ?


      I thought redirects didn't work if you have already printed a header?


      rgds

      Frank

      -----Original Message-----
      From: msws_1 [mailto:scott.list@...]
      Sent: Monday, 4 March 2002 11:04 PM
      To: perl-beginner@yahoogroups.com
      Subject: Re: [PBML] [#2] cgi progressive displaying script ?


      > Try this and let me know if it works! ;-)

      OK, here's the changes and output. Still no redirect happening:
      --------------------------------------
      #!/usr/bin/perl
      use CGI;
      $|=1; # Turn on autoflush
      print "Content-type: text/html\n\n";
      print "<html><body>";
      print "Please wait, processing.";

      # file "stop" exists for this test...
      while (!-e "stop") {
      sleep 2;
      print " .";
      }

      print "<BR><BR>Done, processing......\n\n\n";
      print "</body></html><BR><BR>\n\n";

      # Create a new instance of CGI
      my $query = new CGI;

      # Get the URL to which the user should be directed
      my $target = "http://www.yahoo.com/";

      # Now redirect to the target
      print $query->redirect($target);

      exit;

      ----------------------------
      The result web page (source):
      ----------------------------
      <html><body>Please wait, processing.<BR><BR>Done, processing......


      </body></html><BR><BR>

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

      Thanks again for the help.
      Scott







      Unsubscribing info is here:
      http://help.yahoo.com/help/us/groups/groups-32.html

      Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


      Yahoo! Groups Sponsor
      ADVERTISEMENT




      Unsubscribing info is here:
      http://help.yahoo.com/help/us/groups/groups-32.html

      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.