主要是驗(yàn)證域名的注冊人郵箱是否在用戶驗(yàn)證過郵箱中。
創(chuàng)新互聯(lián)專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于成都網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)、勉縣網(wǎng)絡(luò)推廣、微信小程序開發(fā)、勉縣網(wǎng)絡(luò)營銷、勉縣企業(yè)策劃、勉縣品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運(yùn)營等,從售前售中售后,我們都將竭誠為您服務(wù),您的肯定,是我們最大的嘉獎(jiǎng);創(chuàng)新互聯(lián)為所有大學(xué)生創(chuàng)業(yè)者提供勉縣建站搭建服務(wù),24小時(shí)服務(wù)熱線:18980820575,官方網(wǎng)址:www.cdcxhl.com
用到第三方接口。
會(huì)有點(diǎn)慢,加一個(gè) 進(jìn)行中。。。加載圖。
前臺(tái)代碼:
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(
'進(jìn)行中......'
);
},
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");
}
});
}
--------
后臺(tái)代碼:
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' => "驗(yàn)證成功!" , 'jump' => "");
ajax_return($data);
}else{
$data = array('status' => -3, 'info' => "驗(yàn)證成功但數(shù)據(jù)庫寫入失敗,請聯(lián)系客服!" . $db_whois['id'] . "--" . $sql4, 'jump' => "");
ajax_return($data);
}
}else {
$data = array('status' => 2, 'info' => "驗(yàn)證失??!", 'jump' => "");
ajax_return($data);
}
}