array( 'method'=>"GET", 'timeout'=>4 ) ); $contents = @file_get_contents("compress.zlib://".$url, false, stream_context_create($opts)); preg_match('/(.*?)<\/title>/is',$contents,$title); // 获取网站标题 preg_match('/<link rel=".*?icon" * href="(.*?)".*?>/is', $contents,$icon); // 获取网站icon preg_match('/<meta.+?charset=[^\w]?([-\w]+)/i', $contents,$charset); //获取网站编码 $get_heads = array(); $get_heads['charset']=$charset[1]; $get_heads['title'] = str_replace("'","\"",preg_replace("/\s/","",$title[1])); $get_heads['icon'] = get_urlpath(preg_replace("/\s/","",$icon[1]),$url); if(strtolower($get_heads['charset'])!="uft-8"){ // 将非UTF-8编码转换 $get_heads['title'] = iconv($get_heads['charset'], "UTF-8",$get_heads['title']); $get_heads['icon'] = iconv($get_heads['charset'], "UTF-8",$get_heads['icon']); } return $get_heads; } $head = get_head($_GET['url']); if(empty($head['title'])&&empty($head['icon']))exit('Unable to access'); header('Content-Type:application/json'); exit('{"title": "'.$head['title'].'", "icon": "'.$head['icon'].'","charset": "'.$head['charset'].'"}'); } $grouplists =$DB->query("SELECT * FROM `lylme_groups`"); if(isset($_REQUEST['authcode'])) { session_start(); if(strtolower($_REQUEST['authcode'])== $_SESSION['authcode']) { if(isset($_POST['name'])&& isset($_POST['url'])&& isset($_POST['icon'])&& isset($_POST['group_id'])) { $status = $conf["apply"]; if($status==2) { exit('<script>alert("提交失败,网站已关闭申请收录功能!");window.location.href="./";</script>'); } $name=strip_tags(daddslashes($_POST['name'])); $url=strip_tags(daddslashes($_POST['url'])); $icon=strip_tags(daddslashes($_POST['icon'])); $group_id=strip_tags(daddslashes($_POST['group_id'])); $userip=strip_tags(get_real_ip()); $sw = 1; $date = date("Y-m-d H:i:s"); if(empty($status)) { $status=0; } } function strlens($str) { if(strlen($str) > 255) { return true; } else { return false; } } if($sw == 1) { if(empty($name) || empty($url) || empty($group_id) || empty($userip) ) { //|| empty($icon) exit('<script>alert("提交失败,请确保所有选项都不为空!");history.go(-1);</script>'); } else if(!preg_match('/^http*/i', $url)) { exit('<script>alert("提交失败,输入不符合要求!");history.go(-1);</script>'); } else if(strlens($name)||strlens($url)||strlens($icon)||strlens($group_id)||strlens($userip)) { exit('<script>alert("非法参数!");history.go(-1);</script>'); } else { if($DB->num_rows($DB->query("SELECT * FROM `lylme_apply` WHERE `apply_url` LIKE '".$url."';"))>0) { exit('<script>alert("链接已存在,请勿重复提交,如需修改请联系站长!");history.go(-1);</script>'); } $sql = "INSERT INTO `lylme_apply` (`apply_id`, `apply_name`, `apply_url`, `apply_group`, `apply_icon`, `apply_mail`, `apply_time`, `apply_status`) VALUES (NULL, '".$name."', '".$url."', '".$group_id."', '".$icon."', '".$userip."', '".$date."', '".$status."');"; if($DB->query($sql)) { switch ($status) { case 0: echo '<script>alert("提交成功!请等待管理员审核!");window.location.href="./";</script>'; break; case 1: $link_order = $DB->count('select MAX(id) from `lylme_links`')+1; $sql1 = "INSERT INTO `lylme_links` (`id`, `name`, `group_id`, `url`, `icon`, `PS`,`link_order`) VALUES (NULL, '" . $name . "', '" . $group_id . "', '" . $url . "', '" . $icon . "', '" . $userip . "的提交 ', '" . $link_order . "');"; if($DB->query($sql1)) { echo '<script>alert("提交成功!网站已成功收录!");window.location.href="./";</script>'; } else { echo '<script>alert("提交成功!请等待管理员审核!");</script>'; } break; } } else { echo '<script>alert("提交失败!请联系网站管理员!");history.go(-1);</script>'; } } } } else { echo '<script>alert("验证码错误!");history.go(-1);</script>'; } exit(); } ?> <!DOCTYPE html> <html lang="zh"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> <title>申请收录 - <?php echo $conf['title']?>
 正在获取....
';} else{ echo '
';} ?>

网站已关闭申请收录

'. $conf['apply_gg']. '
'); } ?>

申请收录