Link to home
Start Free TrialLog in
Avatar of akohan
akohan

asked on

how to user cron to update a page?

Hello group,

I need to update a page every 10 minutes (index.php) and I'm thinking of using cron in Linux but I'm not sure how I can do this. What I need is calling/executing the page to show some numbers. These numbers get update and I need to show the updates every 10 minutes.

Regards,
ak
Avatar of Ali Kayahan
Ali Kayahan
Flag of Türkiye image

echo "<META HTTP-EQUIV='refresh' CONTENT='600'>" ; will reload the page after 10 mins,is that it what you are looking for?
ASKER CERTIFIED SOLUTION
Avatar of Adam314
Adam314

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of akohan
akohan

ASKER


Thanks to all. Regarding the first solution; would you please let me know where does it specify to refresh it in 10 mins?
Avatar of akohan

ASKER



Ok, I checked it and now know how it works it is a very nice approach but I won't be able to use it. The reason is that I'm writing an application for FACEBOOK and their server has a parser which ignores parts such as;

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

so basically I cannot use this nice method. Any suggestion?

In case of using it in a cron table still I don't know how to call a index.php.


Is there any PERL or CGI  command that I use to call or load an html or php flle?

Thanks,
ak


Do you want to have the page refreshed in the browser?
Or do you want to have the page updated?


If you want the page refresh, and can't use the meta tag, you could use javascript:
setTimeout("location.reload(True);", 600000);

The 600000 is the number of milliseconds to wait.  600000 mS = 600 Seconds = 10 Minutes.
> .. I don't know how to call a index.php
same question as Adam314:
pleas explain "call index.php", does it mean a refresh in *xour* browser, or do you mean to change the content of index.php every 10 minutes?
For the browser solution see http:#20762574 (requires malware aka javascript enabled in the browser:)
For the index.php solution see http:#20762318
Avatar of akohan

ASKER


Hi,

I'm not sure what  *xour* is but what I want changing the conents (Not in browser). Ok thanks I will look at them.

Regards,
ak

Avatar of akohan

ASKER


Ok that I have done but nothing gets changed when I get back to the page after 10 minutes or more.

I think "*xour*" was a typo, meant to be *our*.

What did you do?  Did you create a script in the crontab?
If so, does the script work when run otherwise?  What is in the script?
sorry for the typos, should read as:

please explain "call index.php", does it mean a refresh in *your* browser, or do you mean to change the content of index.php every 10 minutes?

(as said in http:#20765904 both solutions have been suggsted)
Avatar of akohan

ASKER


Thanks and sorry for being late. I want to change the contents of index.php not in browser.

Thanks.