checksubmit检测是否重复提交订单函数
HTML 代码表单里天添加: <input type="hidden" name="token" value="{$_W['token']}" /> function checksubmit($var = 'submit', $allowget = false) { global $_W, $_GPC; if (empty($_GPC[$var])) { return FALSE; } if(defined('IN_SYS')) { if ($allowget || (($_W['ispost'] && !empty($_W['token']) && $_W['token'] == $_GPC['token']) && (empty($_SERVER['HTTP_REFERER']) || preg_replace("/https?://([^:/]+).*/i", "\1", $_SERVER['HTTP_REFERER']) == preg_replace("/([^:]+).*/", "\1", $_SERVER['HTTP_HOST'])))) { return TRUE; } } else { if(empty($_W['isajax']) && empty($_SESSION['token'][$_GPC['token']])) { message('抱歉,表单已经失效请您重新进入提交数据', referer(), 'error'); } else { unset($_SESSION['token'][$_GPC['token']]); } return TRUE; } return FALSE; }