Php forward

Spacemail by SpaceshipSpacemail by Spaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Watch

Ray

VIP Member
Impact
167
timed php redirect

ok.. i no how to forwar a page to another page, but how would make it so it doest it in a certain amount of time, such as 5 seconds


what i have
<?php
header("Location: $location)
?>
 
Last edited:
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
It should work

Well, if you want it to redirect after x second, use this (not a script, simply HTML):

<META HTTP-EQUIV="refresh" CONTENT="x;URL='http://blablabla.com'">

place this of course in the middle of <HEAD></HEAD> tag and send the page to browser.

If you really want to make it via PHP send the following header:

header("Refresh: $sec; URL=http://blablabla.com");

where $sec means seconds amount of course.
Anyway, PHP "refresh" header throwing is some kind of strange thing when finally still the browser has to make all the work (or not).

By the way, when you want it to redirect after for example 5 seconds, substract from this a time needed to load the page: 1-2 seconds or so - this will be almost accurate counting.

You should also add classic link to the redirected location in case browser will not do it right (sometimes it doesn't work or user has got browser redirection switched off)

Hope it helped!
 
Last edited:
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

The forum home page in the new NamePros Dark style
NamePros Dark has a new look
The dark style of the forum is now darker. The page is close to black, with a slight blue tint. New style: NamePros Dim Do you...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back