I want a script that will make a random # between 1 and 20 (( or 0 and 19 )), then put in an SSI based on that #. (( EX: 01.txt , 02.txt , 03.txt ... 10.txt or 1.txt , 2.txt , 3.txt ... 10.txt ))
If anyone can help me, PLEASE do.
Alicia_8p
02-23-2003, 03:56 AM
Is this what you want?
<ol>
<li>Text...blah, blah....
<li>Text...blah, blah....
<li>Text...blah, blah....
<li>Text...blah, blah....
</ol>
You may have to use PHP, Perl, or some other server side language instead of javascript to do this if the end result is going to be on the same page.
I believe javascript is "clientside" so it won't be executed in time to plunk a result into a "server side" script.
Here's what I was thinking of:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
num=Math.floor(4*Math.random()+1);
document.write("<!--#include file=",num,".txt -->");
// End -->
</SCRIPT>
pb&j is very correct there in noting that javascript is predominantly a clientside language and therefore cannot affect your server parsed code.
I assume though, that if you had use of PHP you wouldn't be using SSI