php实现首页链接查询 友情链接检查的代码
复制代码 代码如下:
/*
* 网站首页超链接反查 友情链接查询 外链查询
* web技术爱好者 lost63.com原创 QQ:35501547
* 转载请注明出处
*/
if($_GET['action']=="check"){
$domain=$_POST['domain'];
//域名表单项为空,则获取地址栏参数
if($domain==""){
$domain=$_GET['domain'];
}
//网址
$url="http://".$domain;
//读取网页,返回网页源文件内容
function read_url($str){
$file=fopen($str,"r") or die($str.'->远程网址读取失败! 点击继续查询
');
while(!feof($file)){
$result.=fgets($file,9999);
}
fclose($file);
return $result;
}
//打开session
session_start();
//如果$_SESSION['matches']没有赋值就设置它;
if(!isset($_SESSION['matches'])){
$result=read_url($url);
preg_match_all('/(.*?)/i',$result,$matches);
$num=count($matches[2]);
for($i=0;$iif(strpos($matches[2][$i],$domain)>0){
unset($matches[2][$i]);
}
}
$_SESSION['matches']=$matches[2];
}
//直接从session中取出包含网址数组;
$matches[2]=$_SESSION['matches'];
$n=count($matches[2]);
$next=0;
$next+=$_GET['next'];
$result=read_url($matches[2][$next]);
if(strpos($result,$domain)>0){
$value=$matches[2][$next].' true
';
}else{
$value=$matches[2][$next].' false
';
}
$values=$_COOKIE['check_result'].$value;
setcookie("check_result",$values,time()+3600);
echo $values;
if($next==$n){
echo "扫描结束!";
}else{
echo '';
}
}else{
//删除cookies
setcookie("check_result","",time()-3600);
echo '';
}
?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version
Useful JavaScript development tools

Atom editor mac version download
The most popular open source editor

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software