大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
主要是验证域名的注册人邮箱是否在用户验证过邮箱中。
创新互联专注为客户提供全方位的互联网综合服务,包含不限于成都网站建设、网站设计、勉县网络推广、微信小程序开发、勉县网络营销、勉县企业策划、勉县品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;创新互联为所有大学生创业者提供勉县建站搭建服务,24小时服务热线:18980820575,官方网址:www.cdcxhl.com
用到第三方接口。
会有点慢,加一个 进行中。。。加载图。
前台代码:
function verifyDomain(val){
var ajaxurl = APP_ROOT+"/index.php?ctl=uc_domainapply&act=verify";
var query = new Object();
query.flag = 1;
query.fhash = __HASH_KEY__;
query.domain = val;
$.ajax({
url: ajaxurl,
dataType: "json",
data:query,
type: "POST",
beforeSend:function(){
$.showSuccess(
'进行中......'
);
},
success: function(ajaxobj){
if(ajaxobj.status==0)
{
$.showSuccess(ajaxobj.info,function (){
if (ajaxobj.jump != '')
location.href = ajaxobj.jump;
else
location.reload();
});
}
else
{
$.showErr(ajaxobj.info, function(){
if (ajaxobj.jump != '')
location.href = ajaxobj.jump;
else
location.reload();
});
}
},
error:function(ajaxobj)
{
alert("error");
}
});
}
--------
后台代码:
function verify(){
$this->check_hash_key();
$domain = strim($_REQUEST['domain']);
if($domain=="") {
$data = array('status' => -2, 'info' => "请传入域名!", 'jump' => "");
ajax_return($data);
}
require_once APP_ROOT_PATH."system/phpwhois/whois.main.php";
$whois = new Whois();
$result = $whois->Lookup($domain);
foreach($result['rawdata'] as $tmp){
if(strpos($tmp,"egistrant Email")){
$arr = explode("Registrant Email: ",$tmp);
}
}
$sql3 = "select * from ".DB_PREFIX."c_whois_email where user_id = ".$GLOBALS['user_info']['id']." and flag = 1 and email = '".trim($arr[1])."'";
$db_whois = $GLOBALS['db']->getRow($sql3);
if($db_whois){
//
$domain_id = $this->get_domain_id($domain);
$sql4 = "update ".DB_PREFIX."c_user_domain set flag = 1 where user_id = ".$GLOBALS['user_info']['id']." and domain_id = ".$domain_id;
if($GLOBALS['db']->query($sql4)) {
$data = array('status' => 2, 'info' => "验证成功!" , 'jump' => "");
ajax_return($data);
}else{
$data = array('status' => -3, 'info' => "验证成功但数据库写入失败,请联系客服!" . $db_whois['id'] . "--" . $sql4, 'jump' => "");
ajax_return($data);
}
}else {
$data = array('status' => 2, 'info' => "验证失败!", 'jump' => "");
ajax_return($data);
}
}