Originally posted by: LeetViet
I need this for any link that is clicked, not just pages where I have to put the target URL. Got one like that minendo?
Originally posted by: WannaFly
wow minendo, you could replace your 15 lines of code with one meta tag....
meta redirect, or refresh, one of them..
edit: just put this in the head section of the page
<meta http-equiv="refresh" content="10;url=urlhere">
Originally posted by: CaseTragedy
If I understood you correctly--this is what you had in mind? Link
I went php since i'm a java noob.
You'll have to send all your links through the php page.
The urls are checked against an existing array (via cookie) and are appended to the array if it isn't found.
I have the cookie set to expire in 1 min. But you can change it to expire in 1 day.
Of course I may be wrong and don't really know what the hell you want. 😉
Originally posted by: CaseTragedy
You mean you want every existing link to be redirected without changing the links themselves?
Correct 🙂
don't think its possible.Originally posted by: LeetViet
Correct. 🙂
Originally posted by: Templeton
You're gonna need to use server and client side scripting. The easiest way would probably be to use the url rewrite engine of apache to redirect all urls to something like redirect.php?page=blah, redirect.php would check a cookie, if the page hasn't been served today, set a cookie and output the page you want to display with a meta tag or some javascript set to refresh to blah in 10 seconds. This way wouldn't require you to change any of the pages you already have. The better way would be to call a function at the top of all your pages(php) that would handle checking/setting of cookies, and appropriate output. Depending on how many pages your site is, using the rewrite engine might be more practical, though a bit slower. You don't need to use php for any of this, any server side scripting language will do. I don't know of any ready made scripts to accomplish what you want, it really shouldn't be too tough to pull off yourself though.
Originally posted by: DeviousTrap
Originally posted by: CaseTragedy
You mean you want every existing link to be redirected without changing the links themselves?
Correct 🙂
Then whats wrong with my idea?
Originally posted by: LeetViet
Originally posted by: DeviousTrap
Originally posted by: CaseTragedy
You mean you want every existing link to be redirected without changing the links themselves?
Correct 🙂
Then whats wrong with my idea?
My forums will not work without an index.php and I don't want to rewrite everything to index2.php or something.
Originally posted by: minendo
<form name="redirect">
<center>
<font face="Arial">
<b>You will be redirected to the script in<br>
<br>
<form><input type="text" size="3" name="redirect2">
</form>seconds</b>
</font>
</center>
<script><!--
var targetURL="NEWURLHERE"
var countdownfrom=10
var currentsecond=document.redirect.redirect2.value=countdownfrom+1
function countredirect(){
if (currentsecond!=1){
currentsecond-=1
document.redirect.redirect2.value=currentsecond
}
else{
window.location=targetURL
return
}
setTimeout("countredirect()",1000)
}
countredirect()
</script>