Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: redirect in more than standalone mode

by Sidhekin (Priest)
on Nov 17, 2006 at 23:51 UTC ( [id://584814]=note: print w/replies, xml ) Need Help??


in reply to redirect in more than standalone mode

If the browser supports Netscape's "refresh" headers (and what browser doesn't, these days?), you can give it a few seconds in which to render the page before redirecting.

To demonstrate, here's a variation of friedo's code:

#!/usr/bin/perl use strict; use warnings; use CGI; my $q = CGI->new; my $delay_seconds = 4; my $url = 'http://somewhere.com/'; print $q->header( -type => 'text/html', -refresh => "$delay_seconds; $url", ); print "<h1>Here's some HTML.</h1>";

Tested with Firefox and Apache.

print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://584814]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2024-04-23 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found