Results 1 to 3 of 3

Thread: Auto Refesh

  1. #1
    Join Date
    Jan 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Auto Refesh

    I often update my website and want the homepage to auto refresh just one time on entry. I have found a loy of informayion on refreshing every few seconds but can't find anything on refreshing the page just once.
    Can anybody help me?

    Derek.

  2. #2
    Join Date
    Dec 2005
    Location
    Moscow, Russia
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    In head of page:
    Code:
    <META http-eqiuv="REFRESH" Content="60; URL=.">
    http://www.google.com/search?q=meta%20refresh

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    1) You've mistyped http-equiv;
    2) That won't refresh it just one time, now will it.
    OP: If you have a server-side language, you should use that to generate the meta-refresh tag like so:
    PHP Code:
    <html>
      <head>
        <?php if(!isset($_GET['a'])) echo('<meta http-equiv="refresh" content="0;url=' $PHP_SELF '?a"/>'); ?>
        <!-- rest of page -->
    If not, you will need to do something client-side like this:
    Code:
    <html>
      <head>
        <script type="text/javascript">
          if(window.location.href.indexOf("?") == -1) window.location.href += "?";
        </script>
        <!-- rest of page -->
    Of course, better still is to just make sure your server changes its modified times properly.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •