View Full Version : Programm code caching?
In case of using the construction of the following type:
<a href="find.asp?w=<%=RND()%>">Next</a>
the operator <%=RND()%> teturnes the only value, that does't change
after reload.
I use the classic ASP (not NET).
By what means we can cansel cashing of the programm code that can be seen at any case.
Help me pls!
steurm
12-04-2003, 12:13 PM
Yep, it is a weird function in asp. Accoring to the language reference of VBScript, this is the Rnd() function : quote:
Rnd Function
Returns a random number.
Rnd[(number)]
The number argument can be any valid numeric expression.
Remarks
The Rnd function returns a value less than 1 but greater than or equal to 0. The value of number determines how Rnd generates a random number:
If number is Rnd generates
Less than zero The same number every time, using number as the seed.
Greater than zero The next random number in the sequence.
Equal to zero The most recently generated number.
Not supplied The next random number in the sequence.
</blockquote id="quote"></font id="quote">
So, according to this explanation, using Rnd(x) with x > 0 or not supplied should give you another generated number. I did some tests but that didn't work. However, using [b]Rnd(-Second(now)) did provide me a different generated number each time I refreshed the page ... [:)]
So try out this, and you should be fine:
[quote]<ahref="find.asp?w=<%=Rnd(-Second(now))%>">Next</a></CODE>
success !
--
Steurm
www.steurm.net/steurm
duane
12-05-2003, 08:34 AM
use this command to "reseed" the RND function
Randomize Timer
followed by your code, i.e.
yourvariable = Int(RND * 10) + 1
will return a random number between 1 and 10.
dw
Thank you very much for your help![:)]
vBulletin® ©Jelsoft Enterprises Ltd.