Jump to content

Recommended Posts

Or you can use HTML or JavaScript...examples below.

 

HTML:

<meta http-equiv="refresh" content="10;url=someurl.com" />

 

JavaScript:

var timeLeft = 10;
var redirectTo = "msn.com";
var timeInt = setInterval(checkTime, 1000);

function checkTime() {
     timeLeft--;
     if (!timeLeft) { clearInterval(timeInt); window.location=redirectTo; }
}

That's about the simplest way.

Link to comment
https://forums.phpfreaks.com/topic/47011-php-redirecting/#findComment-229263
Share on other sites

use header refresh:

header("refresh:10; url=http://www.google.com");

 

What that will do is wait 10secounds then redirect the user to google. change goole's url to your url and place the code where you need it. However make sure there is no output when you call this function. Only send output after you have called it.

Link to comment
https://forums.phpfreaks.com/topic/47011-php-redirecting/#findComment-229264
Share on other sites

use header refresh:

header("refresh:10; url=http://www.google.com");

 

What that will do is wait 10secounds then redirect the user to google. change goole's url to your url and place the code where you need it. However make sure there is no output when you call this function. Only send output after you have called it.

I didn't even know that refresh but still widely supported but hey, I guess it's the exact same thing as using <meta> to do it.  Good call.

Link to comment
https://forums.phpfreaks.com/topic/47011-php-redirecting/#findComment-229268
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.