hugol
12-26-2009, 02:47 AM
Hi!
First post here on the forum, and i hope im posting in the right section!
:thumbsup:
To the problem:
Im currently running a php script who is parsing information from another url and caches it. A cronjob is set up to remove cache after a certain amount of time.
From what I understand, theres no way to update the cache from my sites url via php, I have to refresh the site via client side.
So, what im trying to do is to make Update script, wich is looping trough all my links on my site to update the cache.
Iv tryed with Javascript but I have never worked with it before, whereas I need your help.
This is what iv tryed:
<?php
$year = $_GET['view'];
$type = $_GET['type'];
$chart = $_GET['chart'];
$menu = $_GET['menu'];
$chartDate = $_GET['chartDate'];
$url = "home.php?menu=$menu&chart=$chart&type=$type&chartDate=$chartDate&order=position";
<script type="text/javascript">
<!--
function delayer(){
window.location = "<?php echo $url ?>"
}
//-->
</script>
</head>
<body onLoad="setTimeout('delayer()', 5000)">
<h2>Updating</h2>
<p>Redirecting...</p>
The problem here is that I want it to redirect to next chartDate.
Imagine that the link it starts from is:
home.php?menu=archive&chart=charts&type=europe&chartDate=1965-01-28&order=position
The next chartDate is 1965-02-28, 1965-03-28 => 2009-12-28
Is there any way I can make this happend and automatically?
Hope you understand my question!
Thanks in advance!
:D
First post here on the forum, and i hope im posting in the right section!
:thumbsup:
To the problem:
Im currently running a php script who is parsing information from another url and caches it. A cronjob is set up to remove cache after a certain amount of time.
From what I understand, theres no way to update the cache from my sites url via php, I have to refresh the site via client side.
So, what im trying to do is to make Update script, wich is looping trough all my links on my site to update the cache.
Iv tryed with Javascript but I have never worked with it before, whereas I need your help.
This is what iv tryed:
<?php
$year = $_GET['view'];
$type = $_GET['type'];
$chart = $_GET['chart'];
$menu = $_GET['menu'];
$chartDate = $_GET['chartDate'];
$url = "home.php?menu=$menu&chart=$chart&type=$type&chartDate=$chartDate&order=position";
<script type="text/javascript">
<!--
function delayer(){
window.location = "<?php echo $url ?>"
}
//-->
</script>
</head>
<body onLoad="setTimeout('delayer()', 5000)">
<h2>Updating</h2>
<p>Redirecting...</p>
The problem here is that I want it to redirect to next chartDate.
Imagine that the link it starts from is:
home.php?menu=archive&chart=charts&type=europe&chartDate=1965-01-28&order=position
The next chartDate is 1965-02-28, 1965-03-28 => 2009-12-28
Is there any way I can make this happend and automatically?
Hope you understand my question!
Thanks in advance!
:D