Log in

View Full Version : Redirect Script



benslayton
06-01-2006, 06:49 PM
I have this script that needs to wait 2 min. & 4 secs. before redirecting


<html>
<title>Redirect</title>
<body onload=setTimeout("location.href='http://www.domian.com'",5) bgcolor="#FFFFFF">
</body>
</html>
what does the number 5 go to?

Twey
06-01-2006, 06:55 PM
It causes the script to wait five milliseconds (0.005 of a second) before redirecting.
You should really use a meta refresh here, if you must use anything.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Redirect</title>
<meta http-equiv="refresh" content="124;url=http://www.domian.com">
</head>
<body onload="window.setTimeout(function(){location.href='http://www.domian.com';}, 1000 * (60 * 2 + 4)) style="background-color:white;color:black;">
<p>
Sorry, you should have been redirected to <a href="http://www.domian.com">http://www.domian.com</a>.
</p>
</body>
</html>

benslayton
06-01-2006, 07:10 PM
Ok mypage (http://www.bellsouthpwp2.net/b/e/benslayton124/kristo.htm) is not doing that. I'm trying to beat the flash before it redirects. Sugg.

Jack
06-02-2006, 12:28 AM
The first time I saw "thekristo" I thought it was pretty cool... Still do actually! I wouldn't have it running non-stop though. Kinda gets to much the second/third time around. :)

benslayton
06-02-2006, 02:12 AM
Ok well I still can have it redirect to another page, just need help.

tech_support
06-02-2006, 03:21 AM
Oh...

2min and 4sec...




<html>
<head>
<title>Redirect</title>
<script>
function redirect(url,min,sec) {

setTimeout("window.location = url",min*60*1000+(sec*1000))

}
</script>
</head>
<body onload="redirect('http://www.domain.com',2,4)" bgcolor="#FFFFFF">
Redirecting...
</body>
</html>



Ooops... My Bad :)
Deleted the last post

benslayton
06-04-2006, 10:33 PM
somethings wrong doesn't work.

djr33
06-04-2006, 10:38 PM
Twey posted this:

<meta http-equiv="refresh" content="124;url=http://www.domian.com">

Put that in the head section, with whatever else you want on the page. That will do it.

benslayton
06-04-2006, 11:13 PM
So I changed 124 to 10 to test, that is the time right? If it is it dont work Try It. (http://www.bellsouthpwp2.net/b/e/benslayton124/kristo.htm)

It redirects to entry.asp from the flash. i would make a page called entry.asp but My webserver wont allow asp.

djr33
06-04-2006, 11:22 PM
1. Yes, that's time, in seconds.
2. Nope... not working.
3. in your source, it appears that you might be using xml, with self-closing tags: <link ... />... so... maybe the meta needs to be like <meta ... /> too? Aside from that, looks right. I'm not sure about the /> thing.
4. just change the redirected url, then.
5. If asp isn't allowed, then don't use asp... why are you trying to?

benslayton
06-04-2006, 11:29 PM
Ok I think thats what you mean </meta> at the end?
I'm not trying to use asp.

Oh and still not workin

djr33
06-04-2006, 11:33 PM
no... I mean.... <meta stuffherewhatever />, so that it has the ending to it... it's a single tag, not one that needs to be closed.

ok.. then what do you mean about it not allowing asp? why does is that relevant, then?

benslayton
06-04-2006, 11:47 PM
still dont work,

They do not let you save any php, asp, or cgi stuff.

If you watch the whole flash movie, in that it redirects to entry.asp.

djr33
06-04-2006, 11:51 PM
ah, the flash file has that redirect embedded in it?

no chance you can modify the movie?

can't be that hard to fix...

benslayton
06-04-2006, 11:55 PM
My decompiler is jacked up bad. Freezes my computer up. But yea If I can get it decompiled, that would be no problem.

djr33
06-04-2006, 11:57 PM
I just changed the link using notepad... find and replace.
try that.

I could send you the file I just did, though, if you need it.

However, this appears to be a file from another site. do you have permission? I don't really care, but you're running a risk here, especially if you modify their file, without asking. it's non profit, so probably no big deal. but... be careful... maybe ask.


the main thing here is that using a redirect is a complete shortcut... and not a great idea. you're just trying to stop it from redirecting in the swf... weird. I mean... creative, but not sure how well it'll always work.

benslayton
06-04-2006, 11:57 PM
Hey Wow it just worked??? Sometimes it does sometimes it doesnt.

benslayton
06-04-2006, 11:59 PM
Supposedly, As long as I link back.

djr33
06-05-2006, 12:01 AM
alright. well... you're not changing the content of the movie, just a link... so I don't see that being a huge issue.
using notepad should work
find/replace: entry.asp>yourpage.ext

benslayton
06-05-2006, 12:06 AM
Ok I'm lost can you edit flash through notepad, and can you just give me the txt file??:confused: :confused: ??:confused:

Edit: Or wait do I add this find/replace:
entry.asp>yourpage.ext to the head

djr33
06-05-2006, 12:08 AM
find the URL of the flash file. Make a link, somehow, then save that to your harddrive.
Open the .swf in notepad, not by double clicking and opening in the default.
find/replace, then save.

I could give you it... but it's fairly easy... too big to attach here, I think.

benslayton
06-05-2006, 12:09 AM
Ohhhh, let me try that. didnt know that was possible.

benslayton
06-05-2006, 12:17 AM
Ok well that is coming from there site. let me upload it to mine

djr33
06-05-2006, 12:21 AM
sure.

note that you can't generally edit flash in notepad (well... you can, if you can read the insane code, which is all but impossible), except for things like urls. You can't change the functionality of the link.... but you can change the url, because it stores it as normal characters, to send to the browser as such.

benslayton
06-05-2006, 12:25 AM
Ok I uploaded it to my server and it doesnt work, not the redirection, but the flash itself. I tried the links not that it just dont work. Any clue?

djr33
06-05-2006, 12:41 AM
Well.... there's a chance that changing that could screw up the flash. I wasn't sure how to try it. It played locally (with quicktime), but I didn't know if it would work other ways.

Here's the one I saved, in case it worked better than what you did... I dunno.

http://www.yousendit.com/transfer.php?action=download&ufid=D79419641BB09B7E

benslayton
06-05-2006, 12:48 AM
Ok I direct linked it and that works, thanks

djr33
06-05-2006, 02:07 AM
With notepad? Cool.