分享代码基地会员中心的PHP签到系统,PHP很漂亮的签到界面。签到后,会有不同颜色区分。附带PHP签到源码带安装说明和详细注释。(详细查看https://www.daimajidi.com/deal/574)
JS:
```
function getUrl(strs) {
var url = "/demo/1563064903/" + strs;
return url;
}
function signDay(obj) {
$.post(getUrl("Ajax/signDay"), {}, function(data) {
if(data == -1){
alert("请登录!");return false;
}
var num = obj.find("span").text();
var td = "<td style='background-color:navajowhite;navajowhite ;'>\n\
<div align='right' valign='top'><span style='position:relative;right:20px;'>" + num + "</span></div>\n\
<div align='left'><img width='35px' height='35px' src='" + getUrl('Public') + "/images/other/cart_3.gif' alt='已签到' style='position:relative;left:10px;'>\n\
已签到</div></td>";
obj.before(td);
obj.remove();
if (data > 0) {
alert("签到成功获取 " + data + " 积分");
} else {
alert("今天您已签到!");
}
})
}
</script>
```
网友评论