Generating a random number in an SHTML page

335 Views Asked by At

I need to attach a random number to a query string in an SHTML page. It's straightforward to generate the value in PHP:

function get_random_id(){
  srand ((double) microtime( )*1000000);
  return rand(0,1844);
}

But how do you use this when the SHTML page uses syntax like this?

<img src="<!--#echo var="imagemapgif" -->" name="Image1" width="169" height="41" usemap="#Map" id="Image1">

Anyone know of a syntax manual for SHTML pages? Thanks.

1

There are 1 best solutions below

1
On BEST ANSWER

You need to run an external program to get a random number using a server side include.