1 Star 0 Fork 44

gift / yuncart

forked from web3d / yuncart 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
util.php 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
web3d 提交于 2017-03-18 19:40 . chg dir style
<?php
define("IN_CART", true);
define("SITEPATH", dirname(__FILE__));
require_once SITEPATH . "/init.php";
$action = isset($_GET['action']) ? strtolower(trim($_GET["action"])) : "";
if (!in_array($action, array("seccode", "send", "district", "zip"))) {
die();
}
switch ($action) {
case 'seccode'://验证码
Image::ImageVerify();
break;
case 'send': //发送
$type = trim($_GET["type"]);
if (!in_array($type, array("email", "sms")))
exit();
csetcookie("send" . $type, '1', 300);
//判断发送条件
$lockfile = DATADIR . "/lock/" . "send{$type}.lock";
@$filemtime = filemtime($lockfile);
if (time() - $filemtime < 5)
exit(); // 5s内
touch($lockfile);
set_time_limit(0);
$send = new Send($type);
$send->dosend();
break;
case 'district':
$pid = intval($_GET["pid"]);
$districts = Dis::getDistrict($pid);
exit($districts ? json_encode($districts) : "failure");
break;
case 'zip':
$districtid = intval($_GET["districtid"]);
$zip = Dis::getZip($districtid);
exit($zip);
break;
}
PHP
1
https://gitee.com/zjq528/yuncart.git
git@gitee.com:zjq528/yuncart.git
zjq528
yuncart
yuncart
master

搜索帮助