hwg-basics archives | Feb 2000 | new search | results | previous | next |
Re: Unique number in CGIby "Peter Newton" <c-newton(at)ihug.co.nz> |
|
I didn't see any reply to your query so here's one way:- $number = int rand(99999); This will give you a random whole number between 0 and 99999. To output info to a webpage Well it depends on how you accessed the cgi script If you accessed it using ssi with an "exec" command for example then simply as follows:- print "Content-type:text/html\n\n"; print "The unique number is $number\n"; If you activated the script from a form or an <a href tag then you will have to create the whole page something like this:- print "Content-type:text/html\n\n"; print <<"HTMLHEADER"; <html> <head><title>unique numbers</title> </head> <body> HTMLHEADER ; print "<h3 align=center>My unique numbers page</h3>"; print "My unique number is $number<br>"; print "</body></html>"; Hope this helps Peter Newton ----- Original Message ----- From: "Todd Eddy" <tristar(at)raex.com> > How do I assign a unique number every time someone submits a form. then > how do I print that number on the CGI results? (kinda new to CGI) > > -- > Todd Eddy > tristar(at)raex.com > http://www.vrillusions.com/ > > >
HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA