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

Setting up a PHP redirect

Discussion in 'PHP & Perl' started by Butler, Jul 9, 2008.

  1. Butler

    Butler Registered Member Premium Member

    Joined:
    Feb 4, 2008
    Messages:
    71
    Likes Received:
    1
    I am using this code to set up redirects and clear my referring information. But I want to be able to make the refresh occur after say a two second wait, so I can throw in some more code to stuff a few cookies while they wait, can anyone show me what changes I would need to make in order to do this?

    Code:
    <?php
    echo '<META HTTP-EQUIV="REFRESH" CONTENT="0; URL=http://' . $HTTP_GET_VARS['go2url'] . '">';
    ?>
    Thanks
     
  2. DeskCoder

    DeskCoder Regular Member

    Joined:
    Feb 20, 2008
    Messages:
    376
    Likes Received:
    55
    Occupation:
    Coder
    Location:
    Kentuckiana
    CONTENT="2 ...

    change the 0 to the number of seconds you want to wait.
     
  3. Butler

    Butler Registered Member Premium Member

    Joined:
    Feb 4, 2008
    Messages:
    71
    Likes Received:
    1
    That simple? :eek:

    I thought that was for something else. Thanks for the help, my PHP for dummies is in the post from amazon.
     
  4. ewind

    ewind Registered Member

    Joined:
    Jul 2, 2008
    Messages:
    99
    Likes Received:
    10
    dont want sound noobiesh but i am, does this code hide referer?
     
  5. Butler

    Butler Registered Member Premium Member

    Joined:
    Feb 4, 2008
    Messages:
    71
    Likes Received:
    1
    It does a meta refresh which should blank the referrer, it doesn't work iwth images though.
     
    • Thanks Thanks x 1
  6. blannyjeanna

    blannyjeanna Regular Member

    Joined:
    Mar 14, 2008
    Messages:
    439
    Likes Received:
    19
    Occupation:
    Making money online (try) :-)
    Location:
    Marbella Spain
    why you want to refresh ??????????'
    affiliates link
    redirection

    and work well

    (that disturbing me REFRESH" CONTENT="0) ????????'
    look like blogger no toolbar :)

    best redirection i use
    -http://***********/
    :)
     
  7. barigain

    barigain Junior Member

    Joined:
    Aug 23, 2012
    Messages:
    100
    Likes Received:
    12
    Add to your PHP files
    <?php
    header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
    ?>
    and for static HTML files
    <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
     
  8. sephoral

    sephoral Newbie

    Joined:
    Jan 18, 2014
    Messages:
    14
    Likes Received:
    0
    To be sure, you can add another layer with javascript and make the counter start on focus/mouse move to catch the visitor first

    Regards