Hello, I was wondering how to create a code that opens a link, but before it does so it goes to another page that says: Redirecting to the destined page in 5 seconds... It is sort of like a landing page for all out bound links. Please help, Thank you!!
How about this... <?php header("Refresh: 3; url=\"http://www.google.com\""); echo "You will be redirected to Google in 3 seconds..." ?> Code (markup):
Create: redirect.php Add the following code to it: <?php header("Refresh: 3; url=\"$_GET[url]\""); echo "You will be redirected to $_GET[url] in 3 seconds..." ?> Code (markup): Then you just call the page in this format: redirect.php?url=http://google.com redirect.php?url=http://site.com Peace,
Thanks for the help guys, Is there any way to create a link that will link to a website (google.com), but automatically go through my redirection page (mysite.com/redirectpage) and then redirect to google in a set amount of time. (5seconds) Thanks This may involve .htaccess?
You can also do this with HTML: <META HTTP-EQUIV="Refresh" CONTENT="2; URL=http://www.address_of_the_website_goes_here.com"> <p>You are being redirected. If your browser does not take you there, click <a href="http://www.address_of_the_website_goes_here_too.com">this link</a> to go there manually.</p> HTML: CONTENT="2 is the number of seconds
Mark Oates example is very good, and if u want from ur page to redirect again page to google u can add on mysite.com/redirectpage this line: header("Location: google.com); exit(0);
use javascript: onload=setTimeout("location.href='http://www.google.com'",10000) the number there is in milliseconds. put that code within the opening <body> tag right after the body, so like this <body #put code here#> </body>
If you server supports php, simply use: header("Location: YOURURL"); die(); PHP: Javascript would be crazy to do, as PHP will be the 100% most crossbrowser in this situation. Also, if you use javascript, it will show a white page in a second (even if you set the redirect to 0), and then redirect. PHP will do an imedially redirect.