//检查email是否已经使用过
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname("regcode")." where email='".$_POST['email']."'");
$rs = $_SGLOBAL['db']->fetch_array( $query );
if($rs['checkcode']==1){showmessage('您输入的Email邮箱已经被使用了,请返回重试!');}
//检查发送时间间隔
$posttime = $_SGLOBAL['timestamp']-3600;
if($rs['checkcode']==0 & $_SGLOBAL['timestamp']>$rs[dateline]+3600){
$_SGLOBAL['db']->query("DELETE FROM ".tname('regcode')." WHERE (email='".$_POST['email']."' AND checkcode = 0)");
}
if($rs[dateline]>$posttime){showmessage('重新获取注册码需要间隔1个小时哦!');}
修改成下面红色的
//检查email是否已经使用过
$query = $_SGLOBAL['db']->query("SELECT p.email,a.email FROM ".tname("regcode")." p,".tname('spacefield')." a where p.email='".$_POST['email']."' AND p.checkcode=1 OR a.email='".$_POST['email']."'");
while ($result=$_SGLOBAL['db']->fetch_array( $query )) {
//检查发送时间间隔
$sql = $_SGLOBAL['db']->query("SELECT * FROM ".tname("regcode")." where email='".$_POST['email']."'");
$rs = $_SGLOBAL['db']->fetch_array($sql);
$posttime = $_SGLOBAL['timestamp']-3600;
if($rs['checkcode']==0 & $_SGLOBAL['timestamp']>$rs[dateline]+3600){
$_SGLOBAL['db']->query("DELETE FROM ".tname('regcode')." WHERE (email='".$_POST['email']."' AND checkcode = 0)");
}
if($rs[dateline]>$posttime){showmessage('重新获取注册码需要间隔1个小时哦!');}