ok i have this random number gen. that i need to post the numbers and date to a db
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<?php
$numbers=array();
while (count($numbers)<6) {
$number=rand(1, 1000);
if(!in_array($number,$numbers)) {
array_push($numbers,$number);
}
}
foreach ($numbers as $number) {
$list.="$number, ";
}
$old_data=@file_get_contents("numbers.txt"); // get the current data
$list=substr($list, 0, -2);
$date=date('(r)',mktime());
$data="$date\n$list";
$new_data="$data\n\r$old_data"; // add the new data to the old data
$file = "numbers.txt";
$fh = fopen($file, 'w+') or die("can't open file"); // 'w+' deletes old contents and adds new
fwrite($fh, $new_data); // add new contents
fclose($fh);
echo $data;
?>
<?php
$time_delay = 5; //time to delay before redirect in seconds
$location = 'http://infernus.byethost18.com/index1.html'; //location of the page you wish too redirect too
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"".$time_delay."; URL=".$location."\">\n";
?>
</body>
</html>
then i need to be able to place this info into the following div's:
the most recently added numbers into this div
HTML Code:
<div id="numbers">
</div>
and need the 4 previous sets of numbers here
HTML Code:
<div id="past_numbers">
</div>
<div id="past_numbers">
</div>
<div id="past_numbers">
</div>
<div id="past_numbers">
</div>
having a total of 5 sets of numbers showing
so say the numbers are being generated every week on sunday's
in the numbers div it would have the numbers for nov.1
then in the past_numbers div's have it show oct.25th, 18th, 11th, then 4th.