Jump to content

Redirect: not header redirect


xProteuSx

Recommended Posts

sleep(5);
header('Location: somewhere');
exit();

without using the header funciton

 

Yes, but the poster's reason was:

The reason that I don't want to use a header, is that I need the page to actually display for a few seconds before the redirect takes place.  I've never heard of a time delay on a header redirect ...

 

So I showed the time delay.  :P

sleep(5);
header('Location: somewhere');
exit();

without using the header funciton

 

Yes, but the poster's reason was:

The reason that I don't want to use a header, is that I need the page to actually display for a few seconds before the redirect takes place.  I've never heard of a time delay on a header redirect ...

 

So I showed the time delay.  :P

lol.. very true my friend.. guess its one of those days.. ::)

header("refresh: 5; yourpage.php");

Refresh is not a standard HTTP header. There's no guarantee that'll work.

 

sleep(5);
header('Location: somewhere');
exit();

That won't work at all.

 


The best solution posted yet, though there's also JavaScript to consider.

window.setTimeout(function() { document.location = "http://www.yourdomain.com/index.html"; }, 5000);

sleep(5);
header('Location: somewhere');
exit();

That won't work at all.

 

Really?  How so?

 

Well obviously it works as posted, but not with output before.  My bad.  :wtf:

yes abra this is why I questioned your post previously.. I am assuming that the OP has a good amount of code coming before this procedure and is confused on how to go about this.. then again for something like this.. the header can most likely, and probably should go at the top of the code.. since the OP will want to re-direct the visitor immediately

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.