in reply to Re: redirect in more than standalone mode
in thread redirect in more than standalone mode

Thanks for helping.

OK, going with the OO approach, the redirect to the other script works, but I still don't get "here's some HTML" to print.

Here's what I did.
#! /usr/bin/perl -wT use strict; use CGI qw(:standard escape escapeHTML); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); #all diagnostic t +o browser #print header (), # generate Content-Type header #start_html (-title => "Test redirect"); my $q = CGI->new; print $q->header( -type => 'text/html', -location => 'http://www.gmacfadden.com/cgi-bin/Work +Control/Home/download_file_from_file.cgi'); print "<h1>Here's some HTML.</h1>"; #print end_html (); # generate closing HTML tags exit (0);

Replies are listed 'Best First'.
Re^3: redirect in more than standalone mode
by gloryhack (Deacon) on Nov 17, 2006 at 23:28 UTC
    Try running that from the command line, and you'll see it print your HTML after the redirection header lines. Whether or not the HTML will appear in a web browser will depend upon many things, among them:
    • Is the browser picky about the absence of <head> and <body>?
    • Does the browser bother to show the content if the redirection succeeds?
    • Does the browser have time to render the content before the server that receives the request from the redirect starts talking?

    What it will not do for you, though, is present you with the option to do your download. The redirect is unconditional. If instead you want to present a hyperlink to the download URL, then just do that without bothering with a redirection header.