Hi I'm new!
Okay, I got this 'random link' script from someone:
<?php
// random link
function random_links($file, $display) {
$filenaam = $file . '.txt';
$f = file($filenaam);
srand((double)microtime()*1000000);
for($c=0; $c<=$display; $c++) {
$i = rand(0,count($f)-1);
list ($url, $desc) = split("\|", $f[$i]); $desc = rtrim($desc);
echo '<a href="'.$url.'">'.$desc.'</a><br>';
}
} // einde functie: random_links
?>
<?php
random_links('random_links', 3);
?>
This wil post three random links from the specified textfile, so far so good.
But whenever I refresh the page, new links apear..
Now I would like to control this.
Is it possible to let php generate a static *.html file that only rebuilts itself once a day? But more importantly, how?
I understand there are compilers/generators for this and I've heard about mod_rewrite ?? I'm not a coder and most of the tutorials I can find explain a lot of things I don't care about.
I know people got better things to do but please, help me start up.
Thanks,
Kris