Jump to content

Refresh on load


BreakBreak

Recommended Posts

[quote author=businessman332211 link=topic=112064.msg454667#msg454667 date=1161293546]
infinite loop.
Or if you want a permanent refresh(totally pointless)
<?php
header('Location: page.php');
?>
it will redirect over to the same page over and over and over again, but there is absolutely no point, unless you wnat to piss people off.
[/quote]

that won't ever fully load, however. what he's asking for is to refresh the page [b]after[/b] a full page load. to do this, you'd want to use a javascript refresh. something like this should do the trick:
[code]
window.onload = function() {
  window.location.reload(true);
}
[/code]

remember that with the reload() function, the boolean value passed to it forces it to reload from the server (if it's false, it allows it to reload from cache).
Link to comment
Share on other sites

the function i showed above is a javascript function, so it's a client refresh. if your server times out because your script was running too long, it will simply die as with any other PHP error. as you asked in your initial post, this doesn't actually force the refresh until the page has [b]completed loading[/b], so while the script is running on the server, it will not refresh.

with that said, you'd simply place that code above within script tags in the head of your page like you would with any other javascript function.

good luck!
Link to comment
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.