1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Refreshing a page one single time with no forward?

Discussion in 'HTML & JavaScript' started by dirtbag, Sep 16, 2008.

  1. dirtbag

    dirtbag Senior Member

    Joined:
    Jul 24, 2008
    Messages:
    990
    Likes Received:
    525
    I need a single page to refresh itself one time on load, right back to itself. without adding any extra garbage to the url, is this doable somehow? i can't find an option that works without adding a bunch of trash to the url...
     
  2. Diabolik

    Diabolik Newbie

    Joined:
    Apr 11, 2011
    Messages:
    4
    Likes Received:
    0
    Try this:

    PHP:
    <?php
    if(!isset($_GET['link']))
    {
    header("Location: www.example.com/index.php");
    }
    ?>
     
    Last edited by a moderator: Sep 16, 2008
  3. Diabolik

    Diabolik Newbie

    Joined:
    Apr 11, 2011
    Messages:
    4
    Likes Received:
    0
    If that doesn't work, try this -

    PHP:
    <?php
    header
    ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");  // Date in the past
    header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
    header('Cache-Control: no-store, no-cache, must-revalidate');     // HTTP/1.1
    header'Cache-Control: post-check=0, pre-check=0'false );
    header'Pragma: no-cache' );
    ?>
     
  4. dirtbag

    dirtbag Senior Member

    Joined:
    Jul 24, 2008
    Messages:
    990
    Likes Received:
    525
    i guess i should say it needs to go into a wordpress theme.

    Code:
    Warning: Cannot modify header information - headers already sent by (output started at /usr/home/path/path/public_html/wp-content/themes/web-world-25/header.php:5) in /usr/home/path/path/public_html/wp-content/themes/web-world-25/header.php on line 34
    
    i get similiar "header already sent" error using both segments of code.
     
  5. Diabolik

    Diabolik Newbie

    Joined:
    Apr 11, 2011
    Messages:
    4
    Likes Received:
    0
    You're probably going to have to pay someone to do it.