Forums

ASP

This topic is locked

Random img

Posted 15 Jan 2003 13:00:04
1
has voted
15 Jan 2003 13:00:04 Nathan Pollux posted:
hi guys,

i want to try something but i can't get it to work
i have a win2000 hosting with asp support

i would like to add a random image on one page

how do i get a random number between 0 and x
(x being the total number of images available, this figure may grow when more pictures become available)

so i can have something roughly like this:

src="<b>pic_VarY.jpg</b>"

where VarY = the called random variable between 0 and x
so the filenames are pic_01.jpg, pic_02.jpg etc

or maybe you guys have a better way to do this

cheers

Nos

-------------------------------------------------------------------
I scream in dev/null so nobody can hear me being frustrated.

Replies

Replied 15 Jan 2003 13:29:24
15 Jan 2003 13:29:24 Martha Graham replied:
Check this, maybe it can help you.
www.dmxzone.com/go?1429

Martha Graham
Replied 15 Jan 2003 14:08:12
15 Jan 2003 14:08:12 Nathan Pollux replied:
thx martha

i put the script generated by this xtention in a seperate file, and now i call it using
&lt; !--#include file="random_img.asp" -- &gt;
which i can include in multiple pages
and i can add images without updating all pages, only that one has to be edited.
so thanks a lot, you really helped me out here,

cheers

Nos

-------------------------------------------------------------------
I scream in dev/null so nobody can hear me being frustrated.

Reply to this topic