Forum Moderators: coopster
This allows you to specify your own seed, however I don't find that necessary anymore considering PHP does this for you already with rand.
Note: As of PHP 4.2.0, there is no need to seed the random number generator with srand() or mt_srand() as this is now done automatically.
Good luck!
Maybe if you explained a little but more about what you are trying to accomplish I'll be able to help you better.
Sorry for my misunderstanding; I really wish to help you with this.
....Just picks a number between 0 and 59 each time the page is loaded. I need something that changes randomly per second or minute as well.
I realize that seems like it shouldn't matter because whether someone loads the page every second or every minute it will still be a new random item. But my next step is to try to put some type of timer on it so it changes automatically right before your eyes. But one problem and one step at a time. First I need to get it to pick an item per second or minute randomly, I can figure out how to reload the page automatically later. Hope that clears it up, if not just ask. Thanks!
javascript code
alert(Math.round(Math.random()*59)); //gives you a random number from 0-59
You can then implement setTimeout() to have a 1 second interval between random numbers generated.
If you like this solution that the Javascript Forum would be a much better place to continue this thread.
I really really hope this help you, because so far I haven't done much.
Best of luck! ;)
For instance, write your random information via php, but use javascript to refresh the page after 'x' amount of time. This would cause a new php variable.
The problem with Javascript is that most search spiders don't care (or stick around long enough) to enable JS to do what it needs to do.
So, you could try Pearl/CGI. <--that may be your best bet...but even still.....
Search engines are designed to be quick and efficient. Making it stick around for content is a bad idea.