icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.
Old October 12th, 2004, 2:33 AM   #1 (permalink)
President & CEO
Seasoned Poster
 
!Entkrew.com's Avatar
 
Joined in May 2004
Lives in Los Angeles, Ca
99 posts
Gave thanks: 0
Thanked 0 times
Post Random Number Generator

Well, I think I had it along time ago but I no longer do and I made a new layout and I need a VERY simple / small script to just randomize numbers and that I can Input anywhere (Ie; Img-Etc...)

Code:
<img src="path/to/images/{random}.jpg">
Something like that (that I can just add {random} and It will display it.

If anyone has a code snipet It would be greatfully appreciated thank you in advance.
__________________
Regards,
Edgar Navarro
President and CEO of Entkrew, Inc.

Saprus (x.41.98)Shared-Reseller
Pass8 (x.17.52)Resellers
Entkrew Dedicated Server

3 YEARS with Surpass hosting! '04, '05, '06!
!Entkrew.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 12th, 2004, 10:35 AM   #2 (permalink)
Caffeine fiend
Comfy Contributor
 
pvera's Avatar
 
Joined in Aug 2004
Lives in Reston, Virginia
Hosted on pass15
270 posts
Gave thanks: 0
Thanked 0 times
Try this:

http://us4.php.net/manual/en/function.rand.php
__________________
Pedro
Blog: http://veraperez.com
Reseller: http://veraperez.net
GPG/PGP Key: http://veraperez.com/public.asc
pvera is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 12th, 2004, 4:55 PM   #3 (permalink)
President & CEO
Seasoned Poster
 
!Entkrew.com's Avatar
 
Joined in May 2004
Lives in Los Angeles, Ca
99 posts
Gave thanks: 0
Thanked 0 times
Thanks, I will check it out right now.
__________________
Regards,
Edgar Navarro
President and CEO of Entkrew, Inc.

Saprus (x.41.98)Shared-Reseller
Pass8 (x.17.52)Resellers
Entkrew Dedicated Server

3 YEARS with Surpass hosting! '04, '05, '06!
!Entkrew.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 12th, 2004, 5:05 PM   #4 (permalink)
President & CEO
Seasoned Poster
 
!Entkrew.com's Avatar
 
Joined in May 2004
Lives in Los Angeles, Ca
99 posts
Gave thanks: 0
Thanked 0 times
Well, I checked that out..

Im not a pro-coder so this may sound "noob" or "dumb".

Update: What I had asked, I already figured it out as I just went and uploaded it and did a few test, thats how we all learn aint it ...

Well, what I had asked just incase some one may need this or I forget I can just come back here...

PHP Code:
<?php echo rand(515); ?>
PHP Code:
<img src="images/<?php echo rand(515); ?>.jpg">
Thats What I have (the 2nd one) the first is just the code it self thanks to Pvera for showing me where it was

It just gives out the random number within the image tag (just make sure to change .jpg to whatever file it is you want randomized, and your images dir.
__________________
Regards,
Edgar Navarro
President and CEO of Entkrew, Inc.

Saprus (x.41.98)Shared-Reseller
Pass8 (x.17.52)Resellers
Entkrew Dedicated Server

3 YEARS with Surpass hosting! '04, '05, '06!
!Entkrew.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On