LottoCaptcha is a web service.
In order to display LottoCaptcha on your website, and validate it through LottoCaptcha API.
You will need to get <public> and <private> API keys.

To display LottoCaptcha, simply add this Javascript line :
<script  type="text/javascript" src="http://api.lottocaptcha.com/draw/?h=your_public_key"> </script>
you want to protect.

Replace <your_public_key> with your LottoCaptcha public key.
This Javascript line will query LottoCaptcha API server, pick random lottery numbers and display LottoCaptcha widget.

Possible display errors:
Message Description
Key not valid Public key is not valid.
Status not active Publisher status is inactive.
Can not serve lottery Undefined error.

After user initialize submit request (press form submit button).
LottoCaptcha script will query LottoCaptcha API server to validate entered numbers against LottoCaptcha winning numbers.
If numbers match, user will see “Congratulation” message and will proceed with prize claim procedure.

If user hits the JackPot then publisher (site owner) will receive 50 % of Jackpot amount.
LottoCapcha staff will contact publisher with prize claim details.
Otherwise (numbers do not match winning numbers).
You will need to validate the user response,by reading fallowing fields submitted in <form> from user web page to your web server.
Fields list:
User's IP address
And pass these fields in POST request to http://api.lottocaptcha.com/varify/

Then read LottoCaptcha API response.
LottCaptcha API response format and values:
Return Value Description
true User's respone was correct.
false User's respone was incorrect.
PrivateKey_Required We didn't receive your private key. Please set
POST parameter.
ChallengeValue_Required We didn't receive lottocaptcha_challenge_field value . Please set
POST parameter .
ResponseValue_Required We didn't receive lottocaptcha_response_field value . Please set
POST parameter .
RemoteIp_Required We didn't receive user's IP address . Please set
POST parameter .
ChallengeValue_Invalid We received invalid lottocaptcha_challenge_field value. Please check your POST parameters.
PrivateKey_Invalid We received invalid private key. Please make sure you set correct key.
RemoteIp_Invalid User's IP adress is invalid. User security check failed.
Already_Checked We already checked this LottoCaptcha challenge before.

PHP example
ASP example
<% If Request("lottocaptcha_challenge_field") <> "" Then PrivateKey = "your_private_key" ' Set your private key ChallengeValue = Request("lottocaptcha_challenge_field") ResponseValue = Request("lottocaptcha_response_field") RemoteIp = Request.ServerVariables("REMOTE_ADDR") ValidMessage = varifyLottoCaptcha(PrivateKey, ChallengeValue, ResponseValue, RemoteIp) If ValidMessage = "true" Then Response.Write "Correct" ' Corrent answer Else Response.Write ValidMessage ' Wrong answer End If Else %> <% PublicKey = "your_public_key" ' Set your public key / head Response.Write getLottoCaptcha(PublicKey) %> <% End If %>
© 2011 LottoCAPTCHA All Rights Reserved.