You can use the Random.Netiden API from your website to generate a random number, or you can generate it yourself.
Calling the Random.Netiden API:
You can call this API from your website at:
http://soap.netiden.com/random.netiden
or, for SSL connections:
https://soap.netiden.com/random.netiden
The result of the Random.Netiden API is a field called <Number>:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <Random xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
Calling the Random.Netiden API in ASP:
<%
dim oHttp
dim xmldom
dim txtRequestString
dim result
set oHttp = CreateObject("MSXML2.XMLHTTP")
set xmldom = CreateObject("msxml2.domdocument")
'DEFINES THE REQUEST STRING VARIABLE
txtRequestString = "http://soap.netiden.com/Random.netiden"
'CALLS THE NETIDEN API
oHttp.open "GET",txtRequestString , false
oHttp.send
xmldom.async =false
xmldom.loadXML (oHttp.responseText)
If (xmldom.parseError.errorCode <> 0) Then
Dim myErr
Set myErr = xmldom.parseError
Else
For i=0 to xmldom.documentElement.childNodes.length-1
Set currNode = xmldom.documentElement.childNodes.Item(i)
Select Case currNode.nodeName
case "Number"
Number=currNode.nodeTypedValue
End Select
Next
End If
Response.write (Number)
%>
Generating a random number in ASP:
Randomize
randcode = Int(9000 * Rnd + 1000)
Generating a random number in PHP:
$random = (rand() % 9000) + 1000; |