You are invited to Log in or Register a free Frihost Account!

Need Help in PHP

Hi all,
I need a simple casino script which will display random number in between 0-99 for each 15 minutes intervel. the number should begin to start rotate 1 min before results


9.14 - the random number in between 0 - 99 should randomly appear for every second.
9.15 - the random process should stop and the last random number should be in screen upto 9.34

i do this project in vb and now want to change it in php. Thanks in advance.

not sure php is the best language to use for this, maybe look into javascript if you want it to be web based. php is not very good at time delays, it wants to execute its code and then stop, not sit around idle waiting for the next interval.

if you could explain what you are hoping to do with this script i could prolly give a few pointers, but as i dont know how it will be implemented i cant offer any help.

is this going to be online? do you need to save results? why spend 1 min going through numbers which wont be used? why every 15 mins? what happens during the 14 mins of nothing happening?
I am not sure you can do this only with php. In combination with ajax maybe I can create something useful. Nemesis234 is faster then me and ask good questions. Waiting for answers.

Agreed, explain why you want to do this and we can give you a good solution. What you are asking does not make sense to do in php.

If you do just want to generate a new random number every fifteen minutes, the basic way to do it would be to store the number in your database with a timestamp. Then read that value and generate a new one if it is 15 minutes old or older. Probably gives the same effect (I don't know why you wanted to constantly generate numbers for a minute then stop at 15 minutes though, that's a waste of the CPU and it is no more random than what I propose).

Waiting to hear why you want this though.
you can never do this with php and access it with browser. it will timed out.

if the script run in background at server (using sleep), you can never push it to browser.

if you don't need to hide anything, javascript settimeout should be just fine.

if there is something you want to hide from user (when user view source), then you need to use javascript and ajax.
Related topics
Zapraszam do mojej gry :)
[HELP] PHP -> Scripting
Needing a Bit Og Help {PHP}!
need some help - php switch code
[SUPORTE] Imagem de status do MSN
[man][help]PHP... What you think?
help,php books
Please help. php script installation error
I need help yet again
[help][php] Ayuda con las cadenas
[HELP] PHP (and some MyBB) Administration
Error with MySQL and PHP script in my CMS
Session directory permissions issue
[Help] php script to post to twitter
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

© 2005-2011 Frihost, forums powered by phpBB.