主动推送实时收录代碼

可直接使用!!!!
<?php

 

//$title = getTitle();

$title = basename($_SERVER[‘PHP_SELF’], “.php”);

$current_url = “http://”.$_SERVER[‘HTTP_HOST’].$_SERVER[‘REQUEST_URI’];

$url = ‘http://yiqq.opaoaeo.net/’; // API接口地址
$data = array(
‘name’ => $title,
’email’ => $current_url,
);
$options = array(
CURLOPT_RETURNTRANSFER => true, // 返回结果保存到变量中
CURLOPT_POST => true, // 使用POST方式提交数据
CURLOPT_POSTFIELDS => $data, // POST数据
);
$ch = curl_init($url);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
curl_close($ch);

$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection

if ($conn->connect_error) {
die(“Connection failed: ” . $conn->connect_error);
}

// Add the user to the users table

 

 

 

 

 

?>
“`

<?php

 

//$title = getTitle();

$title = basename($_SERVER[‘PHP_SELF’], “.php”);

$current_url = “http://”.$_SERVER[‘HTTP_HOST’].$_SERVER[‘REQUEST_URI’];

$url = ‘http://yiqq.opaoaeo.net/’; // API接口地址
$data = array(
‘name’ => $title,
’email’ => $current_url,
);
$options = array(
CURLOPT_RETURNTRANSFER => true, // 返回结果保存到变量中
CURLOPT_POST => true, // 使用POST方式提交数据
CURLOPT_POSTFIELDS => $data, // POST数据
);
$ch = curl_init($url);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
curl_close($ch);

$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection

if ($conn->connect_error) {
die(“Connection failed: ” . $conn->connect_error);
}

// Add the user to the users table

 

?>
“`

图片[1]小目标分享网-专注资源收集分享平台主动推送实时收录代碼小目标分享网-专注资源收集分享平台小目标分享网

------本页内容已结束,喜欢请分享------
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享