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 use PHP+Ajax to realize the lucky draw program of mobile terminal Nine Miyagi

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly explains "how to use PHP+Ajax to realize the mobile Jiugong lucky draw program". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use PHP+Ajax to realize the mobile Jiugong lucky draw program".

PHP+Ajax combined with an example of the lucky draw for a Wechat mobile phone made by lottery.js. After the completion of the lucky draw, a form for adding the receiving address appears. Support can set the winning probability and so on.

Prize list

Ajax lucky draw

$.post ("ajax.php", function (data) {/ / get the prize. You can also determine whether the login status is if (data.prize_id! =''& & data.prize_id! = undefined) {var prize_site = $(".lottery -" + data.prize_id) .attr ("data-ord"); $("# lottery") .attr ("prize_site", prize_site) $("# lottery"). Attr ("prize_id", data.prize_id); $("# lottery"). Attr ("prize_name", data.prize_name); $("# lottery"). Attr ("prize_pic", data.prize_pic); if (data.code = = 200) {$("# lottery"). Attr ("contact_name", data.contact_name) ("# lottery"). Attr ("contact_mobile", data.contact_mobile); $("# lottery"). Attr ("contact_addr", data.contact_addr);} roll (); click = true; return false;} else {showLotteryTip (data.error);}}, "json")

Save the receiving address

$.post ("ajax.php", {contact_name: contact_name, contact_mobile: contact_mobile, contact_addr: contact_addr}, function (data) {$("# lottery_addr_box"). Modal ('hide'); if (data.code = = 200) {$("# tip_words"). Html ("submitted successfully!") ; getModalBox ('# lottery_tip');} else {showLotteryTip (data.error) }, "json") Thank you for your reading. The above is the content of "how to use PHP+Ajax to realize the mobile Jiugong lucky draw program". After the study of this article, I believe you have a deeper understanding of how to use PHP+Ajax to realize the mobile Jiugong lucky draw program, and the specific use still needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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

Servers

Wechat

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

12
Report