File : random.cgi


#!/usr/local/bin/bush

pragma annotate( "random.cgi" );
pragma annotate( "" );
pragma annotate( "Display a random number when the page is loaded" );
pragma annotate( "by Ken O. Burtch" );

-- run env and get ther results

random_number : positive := numerics.rnd(100);

-- display the results using this template

pragma template( html, "random.tmpl" );


<!-- random.tmpl: Display a random number when the page is loaded -->
<html>
<head>
<title>random.cgi example</title>
</head>
<body>
<h1>Your random number between 1 and 100 is</h1>
<p><?bush ? random_number; ?></p>
</body>
</html>