1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

header("location:page.php") delay

Discussion in 'PHP' started by Kyriakos, Sep 22, 2008.

  1. #1
    hi,

    i want to delay the
    header("location:page.php");
    PHP:
    about 3 seconds. is this possible?
     
    Kyriakos, Sep 22, 2008 IP
  2. adammiller

    adammiller Peon

    Messages:
    184
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'm not aware of being able to do it in php. Try echoing a javascript delayed redirect, that will work as its client side. Unless anyone knows if this can be done in php???
     
    adammiller, Sep 22, 2008 IP
  3. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can do it one of the following ways
    • Use a javascript delay as mentioned above
    • Use a meta refresh
    • Use sleep(3); to delay the execution for 3 seconds
     
    JAY6390, Sep 22, 2008 IP
  4. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #4
    header('Refresh:3 ; URL=index.php');
    PHP:
    this delay for 3 seconds..
    you can print something like:

    
    print 'Redirecting...';
    header('Refresh:3 ; URL=index.php');
    
    PHP:
    cheers
     
    ads2help, Sep 22, 2008 IP
  5. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I find the meta much better than the header method, although essentially the same

    <meta http-equiv="refresh" content="3;url=http://www.example.com/yourpage.php" />
    HTML:
    which will refresh after 3 seconds. This is for those pages like the one where you log in to this forum, and it says thankyou for logging in
     
    JAY6390, Sep 22, 2008 IP