Page 1 of 1

Help with header function

Posted: Mon Jun 11, 2012 10:50 am
by vlio20
Hi,
I want to create a web page that when other page links to it, it links to it with some information

Code: Select all

(page.php?action=1)
.
The page needs to be refreshed every minute, so I used

Code: Select all

header("Refresh: 60;");
.
After the refresh I want that the path would be

Code: Select all

(page.php?action='')
, how can I do this???

Thanks

Re: Help with header function

Posted: Mon Jun 11, 2012 12:56 pm
by requinix
Refresh as a HTTP header isn't always obeyed (as it shouldn't because it's non-standard).

Code: Select all

<meta http-equiv="Refresh" content="60; url=page.php?action=''" />

Re: Help with header function

Posted: Mon Jun 11, 2012 1:01 pm
by vlio20
Thanks

Re: Help with header function

Posted: Sat Jun 16, 2012 11:04 pm
by xtiano77
You should consider using the JavaScript “setInterval()” function on your page. Check out the page below:
http://www.w3schools.com/js/js_timing.asp

Re: Help with header function

Posted: Sun Jun 17, 2012 3:41 am
by requinix
xtiano77 wrote:You should consider using the JavaScript “setInterval()” function on your page. Check out the page below:
http://www.w3schools.com/js/js_timing.asp
1. setTimeout() would be more appropriate.
2. It requires JavaScript while a <meta> does not.
3a. W3Schools is a horrible resource. Please don't point people there.
3b. For instance, that page says you "must" use a global variable for the handle returned by setTimeout() and setInterval().
3c. It also says the code will be executed after whatever amount of time. This is incorrect: the code will be queued up at that moment to be run at the next opportunity.