HTML Number Generator

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

HTML Number Generator

Post by nickman013 »

Hello,

i have a html order form that needs a number generator. for example it generates random 5 digit numbers or letters.

if anyone has any information on how to do this please tell me.

Thanks!
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

I don't think it can be done with an "HTML" page. HTML pages are 'static' by definition and can not have dynamic information put into them without some kind of server side scripting language....that's where PHP comes into play.

You can generate HTML code with php and inject your random number that way.

something like this should work (for a purley 5 digit random number):

Code: Select all

echo substr(rand(1,100000),0,5);
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

thank you! :D
Post Reply