auto refresh every 20 mins

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kingdbag
Forum Newbie
Posts: 22
Joined: Wed Jul 12, 2006 6:22 pm

auto refresh every 20 mins

Post by kingdbag »

Hey guys,

I tried searching for this and didn't find anything. I just need php to refresh a web page that is loaded every 20 mins until that page is no longer the current page. (So techincally it should refresh every 20 till forever)

I found some javascript that could do it but i'd much rather use php...

Any tips would be appreciated...
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Use the meta refresh tag in the HTML header.
(#10850)
User avatar
ok
Forum Contributor
Posts: 393
Joined: Wed May 31, 2006 9:20 am
Location: The Holy Land

Post by ok »

There are two types of refresh:
1. PHP

Code: Select all

header("Location: http://www.example.com");
This will refresh/redirect immediately (you will see a blank page and then 'http://www.example.com').

2.HTML - Meta Tag (arborint)

Code: Select all

<META HTTP-EQUIV='Refresh' CONTENT='0 ;URL= http://www.example.com '>
The above will refresh every 0 seconds. If you want every 20 seconds to refresh:

Code: Select all

<META HTTP-EQUIV='Refresh' CONTENT='20 ;URL= http://www.example.com '>
Easy!!!
kingdbag
Forum Newbie
Posts: 22
Joined: Wed Jul 12, 2006 6:22 pm

Post by kingdbag »

ahhh damn i forgot about the html one... been a long time since I've done any html or php thanks guys!
Post Reply