Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to make Nine Miyagi Lottery Program by php+lottery.js

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to make Nine Palace Lattice draw procedure by php+lottery.js". Friends who are interested might as well take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to make the lucky draw program of Nine Palace Lattice by php+lottery.js.

Php+lottery.js makes a lucky draw example of Nine Palace Lattice. This lucky draw features good performance, easy to customize, good for beginners to learn and use directly. It is compatible with browsers such as IE, Firefox and Google.

Introduce the lottery plug-in lottery.js

Start the lottery function start_lottery ()

Function start_lottery () {if (flag) {/ / alert ('raffle is in progress, please wait for the raffle result') ; / / return false; return void (0);} flag=true; index = 1; / / the position of the currently selected object fast = rand (3Magin6); / / where to start accelerating cycle = rand (3Power5); / / how many turns speed = 300 / / start speed $.ajax ({url: 'lottery.php', type: "post", data:null, dataType: "json", timeout: 20000, cache: false, beforeSend: function () {/ / before submission}, error: function () {/ / error flag=false }, success: function (res) {/ / successful if (typeof (res.award_id)! = 'undefined') {lucky = res.award_id; / / winning number award = res.award_name; / / prize name show_lottery ();} else {flag=false Alert (res.err);})

Prize allocation in PHP

/ / prize configuration $award = array (/ / prize ID = > array ('prize name', probability) 1 = > array ('Wukong doll', 0.1), 2 = > array ('little tiger doll', 0.1), 3 = > array ('mystery gift bag', 0.1), 4 = > array ('smart game handle', 0.1), 5 = > array ('little antler doll', 0.1) 6 = > array, 7 = > array (game headphones, 0.2), 8 = > array (Thunder Snake Keyboard, 0.2) R = rand (1100); at this point, I believe you have a better understanding of "how to make the nine-grid lucky draw program by php+lottery.js". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report