Hello, I need a script which : - Would show random number from 50-300 depends on time . - would change very 2-3 min. e.g. : if we have 01 AM then there will be 55 if 3PM then 276 if 8PM then 189 and it need to change every few min. Cheers
Hi When you say you need a random number that would mean that at 3PM the number could be anywhere between 50-300. In your example you said if 3PM then 276 if 8PM then 189 Does that mean at 3PM you wan't it to show 276... or do you mean it could be any number such as 68,125,234 and so on.... If its just any random number, contact me and I can do it for free as its a very very simple script. Thanks, Tom
From what it sounds like, what you're asking for is a pretty simple script. $fname = "storefile.txt"; $minute = date("i"); if (file_exists($fname)) { $datastr = file_get_contents($fname); $datarr = explode(",",$datastr); $mincheck = $datarr[0] + 2; if ($minute > $mincheck) { $newnum = rand(50,300); $handle = fopen($fname,"w"); fwrite($handle,"$minute,$newnum"); fclose($handle); echo $newnum; } else { echo $datarr[1]; } } else { $newnum = rand(50,300); $handle = fopen($fname,"x"); fwrite($handle,"$minute,$newnum"); fclose($handle); echo $newnum; } PHP: Can be made even simpler if your webhost allows you to use the alternative PHP cache.
hm... thanks for the pms but : yeah I also do not know if you get me : I want script as I posted and number should change every 2-3 min , depends on hour it should be less range of numbers let me show you : script should change numbers like that : time [ in h.] | range egzample : 00-01 | 50-100 - At 00:25 there will be 88 00-01 | 50-100 01-04 | 100-200 04-05 | 100-300 05-06 | 100-150 06-07 | 50-100 07-08 | 100-200 08-09 | 100-200 09-10 | 100-300 10-20 | 100-300 20-24 | 50-200 ------------ Numbers should change every 5min.(meby it will be easier to set up 1 number than a 3-5 ) randomly for a few points up and down [ in 5-20 range ] egzample : We have a 00h so we have >>> 00-01 | 50-100<<< 00:05 - 63 00:12 - 57 00:18 - 75 00:27 - 66 00:30 - 49 00:35 - 69 00:41 - 85 and so on.. ----- My server has a php so it shouldn't be any problem with your script I guess. --- Please do not pm with price like 100$ coz I do not want to pay so much for such script. Leave your qestions if you still have any