Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Justin

Justin Avatar
:)

****
Senior Member

256


July 2009
Well i want to make my first code for an actual website

so i have this website where i have "Superstar Of The Day" but i want to make a Code where i insert peoples name and it randomly generates a name every 24 hours, but i have no idea what to insert, so yes gonna be hard for me to create xD.

any tips to a newbie on what to insert? :P
My signature
[/left][/i][/size]

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
In all honesty, it's fairly easy. :)

www.shawnolson.net/a/789/make-javascript-mathrandom-useful.html

That is a decent tutorial that explains how to generate a random number. The next thing is learning how to get a random item from an array.

www.webdeveloper.com/forum/archive/index.php/t-86785.html

The second post in that thread shows how to randomly get a quote. A very basic, but helpful method.

That should cover about all you need. :) If you have any questions, post back.

Andrew McGivery

Andrew McGivery Avatar
Formerly Fredy

******
Legendary Studio Member

Male
5,742


September 2005
Only problem is, he said he wanted it to generate a new one every 24 hours, not everytime you load the page. :P
k

Tobias

Tobias Avatar

***
Dedicated Member

182


November 2006
Andrew McGivery Avatar
Only problem is, he said he wanted it to generate a new one every 24 hours, not everytime you load the page. :P
Use a hash of the date, maybe?
#intj (Mastermind)^

newBookmarkLockedFalling