可直接使用!!!!
<?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
?>
“`