Welcome to WebmasterWorld Guest from 54.198.118.102

Forum Moderators: incrediBILL

Message Too Old, No Replies

Redirecting Scripts

auto redirect from a to b?

     
10:32 pm on Sep 25, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 19, 2001
posts:123
votes: 0


Any one know how I can have a visitor automatically redirected to another url as they enter a page. So when the visitor enters page1.hml, as soon as the page loads, a message is displayed saying: please stand by... Redirecting..." I need a free java or perl script? Or another trick?
10:48 pm on Sept 25, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 18, 2002
posts:161
votes: 0


Either:

Javascript called from "onload"

function ReDirect() {
var i, args=ReDirect.arguments; document.returnValue = false;
for (i=0; i<(args.length-1); i+=2)
eval(args[i]+".location='"+args[i+1]+"'");
}

<body onload="Redirect('YourFrame','YourNewURL');return document.returnValue">
</body>

Or:

<meta http-equiv="Refresh" content="TimeDelay;URL=YourNewUrl" />

asp

11:16 pm on Sept 25, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 19, 2001
posts:123
votes: 0


Thanks, but they don't seem to work
11:55 pm on Sept 25, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 18, 2002
posts:161
votes: 0


Following works fine for me:

<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<meta http-equiv="refresh" content="5;URL=http://www.google.com" />
</body>
</html>

asp

12:05 am on Sept 26, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 19, 2001
posts:123
votes: 0


OK, I got it!

The 1st one you gave me did not work for me.
<meta http-equiv="Refresh" content="TimeDelay;URL=http://www.google.com" />

I found this and it worked.
<META HTTP-EQUIV="Refresh" CONTENT="3; url=http://www.google.com">

This other one you gave me works and looks the same.
<meta http-equiv="refresh" content="5;URL=http://www.google.com" />

What is the #3 or #5 for in CONTENT="3? Is it the value of delay time? I'm 99.9% sure it is.

Once again, thank you very much for the help!

12:07 am on Sept 26, 2002 (gmt 0)

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15756
votes: 0


it is the number of seconds until it redirects.

<meta http-equiv="Refresh" content="TimeDelay;URL=YourNewUrl" />

You have to replace TimeDelay with a number and then YourNewUrl with the url you want to redirect to.

2:27 am on Sept 26, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 19, 2001
posts:123
votes: 0


Thanks guys! I got it and I'm in business now. I can always count on the webmasters world members for help. Special thanks to the site as well.