Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Need automatic forwarding perl script

1 view
Skip to first unread message

Beny Spensieri

unread,
Mar 27, 1999, 3:00:00 AM3/27/99
to
I need a script that will forward a user to another page after a
few seconds. This is commonly used to send web serfers to the
new location of a web page that has moved.

Please e-mail your responses to me, thanks.

Beny
--
___________ "I have summoned you here for a purpose..."
// I \\ "Nobody summons Megatron!"
// I \\ "Then it pleases me to be the
first..."
// /UUU\ \\
II /UUUUUUU\ II
II======]U> <U[======II o
II \UUUUUUU/ II /|\\
\\ \UUU/ // / \
\\ I //
\\_____I_____//

KJS

unread,
Mar 27, 1999, 3:00:00 AM3/27/99
to
Have you tried

print"Location: http://PAGE HERE

Beny Spensieri wrote in message <36FD1EE7...@utoronto.ca>...

Frank de Bot

unread,
Mar 27, 1999, 3:00:00 AM3/27/99
to
This is not right. It must be:

print "Location: http://mypage.com\n\n";

(You forgot the double "\n" and the end (";)

Karen J. Cravens

unread,
Mar 27, 1999, 3:00:00 AM3/27/99
to
"Beny Spensieri" bernardino...@utoronto.ca wrote in
<36FD1EE7...@utoronto.ca>:

> I need a script that will forward a user to another page after a
> few seconds. This is commonly used to send web serfers to the
> new location of a web page that has moved.

Scripts aren't needed for that; simply put

<META HTTP-EQUIV="refresh" CONTENT="5; URL=http://newurl">

in the HTML, somewhere between <HEAD> and </HEAD>. (Replace the 5 with
the number of seconds you want to delay.)

Doesn't work with all browsers, hence the usual "If your browser doesn't
automatically take you, click here" link also found on such pages.


J. Parsons

unread,
Mar 27, 1999, 3:00:00 AM3/27/99
to
Realize of course that this NG is for Perl questions. For searching for
scripts, try one of those search engine things. They put so much hard work
into them, it would be a damn shame not to use them.

To answer your question, you don't need a script to do what you're asking.
Put this in your page:

<html>
<head>
<title></title>
<meta http-equiv="REFRESH" content="1; url=http://www.new-site.com">
</head>
<body>

</body>
</html>


-------------

content="1 Change the 1 to the # of seconds before moving them.
url=http://www.new-site.com Change to the new site to send to.

That's all. Good Luck.


Beny Spensieri <bernardino...@utoronto.ca> wrote in message
news:36FD1EE7...@utoronto.ca...


> I need a script that will forward a user to another page after a
> few seconds. This is commonly used to send web serfers to the
> new location of a web page that has moved.
>

Abigail

unread,
Mar 29, 1999, 3:00:00 AM3/29/99
to
Beny Spensieri (bernardino...@utoronto.ca) wrote on MMXXXIV
September MCMXCIII in <URL:news:36FD1EE7...@utoronto.ca>:
## I need a script that will forward a user to another page after a
## few seconds. This is commonly used to send web serfers to the
## new location of a web page that has moved.


That answer can be found in the HTTP RFCs. It's not a Perl question,
unless you don't know how to use "print". But that's found in the
manual.


Abigail
--
perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
print chr 0x$& and q
qq}*excess********}'

Abigail

unread,
Mar 29, 1999, 3:00:00 AM3/29/99
to
Karen J. Cravens (silve...@wirebird.com) wrote on MMXXXIV September
MCMXCIII in <URL:news:8D96A975...@news.southwind.net>:
,, "Beny Spensieri" bernardino...@utoronto.ca wrote in
,, <36FD1EE7...@utoronto.ca>:
,,
,, > I need a script that will forward a user to another page after a
,, > few seconds. This is commonly used to send web serfers to the
,, > new location of a web page that has moved.
,,
,, Scripts aren't needed for that; simply put
,,
,, <META HTTP-EQUIV="refresh" CONTENT="5; URL=http://newurl">
,,
,, in the HTML, somewhere between <HEAD> and </HEAD>. (Replace the 5 with
,, the number of seconds you want to delay.)
,,
,, Doesn't work with all browsers, hence the usual "If your browser doesn't
,, automatically take you, click here" link also found on such pages.


This has nothing to do with Perl. Besides, it's a hack (not part of
the HTML standard) and a hack that only works with certain browsers,
and certain document types. Furthermore, it's slow, because the browser
has to parse the page. On top of that, your browsers/proxies have to do
the same exercise over and over again, each time when going to said URL.

It's better not to use hacks invented by incompetent browers vendors
(like Netscape). Instead, use the HTTP standard.

Followups set.

Abigail
--
perl -we '$_ = q ?4a75737420616e6f74686572205065726c204861636b65720as?;??;
for (??;(??)x??;??)
{??;s;(..)s?;qq ?print chr 0x$1 and \161 ss?;excess;??}'

Abigail

unread,
Mar 29, 1999, 3:00:00 AM3/29/99
to
J. Parsons (gs...@usa.net) wrote on MMXXXV September MCMXCIII in
<URL:news:7djs3n$k...@news1.snet.net>:
\\
\\ To answer your question, you don't need a script to do what you're asking.

\\ Put this in your page:
\\
\\ <meta http-equiv="REFRESH" content="1; url=http://www.new-site.com">


This is bad. Very bad. A sign of an incompetent author.
See my other posting on this subject.


Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'

Karen J. Cravens

unread,
Mar 29, 1999, 3:00:00 AM3/29/99
to
"Abigail" abi...@fnx.com wrote in <7dmiaq$ckp$4...@client2.news.psi.net>:

>This is bad. Very bad. A sign of an incompetent author.
>See my other posting on this subject.

The META tag is the only method that allows you to inform the reader that
they're being redirected, and why. It's a perfectly valid use, when
combined with a "click here if your browser doesn't take you there" link.

At any rate, CGI.pm supports this method of refresh/redirection in its
"header" method, as well as the RFC-approved immediate redirect with the
"redirect" method.


0 new messages