用php写成查询代码 需要有样式接口地址:httpsvapiaa1cnapiapi-qq-gjindexphp返回格式:JSON请求方式:GET 暂无层级展示仅供参考 code 1:返回正常0:返回错误 qq qq号码 money qq价格 dengji qq等级 vip 1:非会员2:会员
<!DOCTYPE html>
<html>
<head>
<title>查询QQ信息</title>
<style type="text/css">
table {
border-collapse: collapse;
width: 50%;
margin: auto;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
}
th, td {
padding: 8px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
background-color: #4CAF50;
color: white;
}
tr:hover {
background-color: #f5f5f5;
}
</style>
</head>
<body>
<h1>查询QQ信息</h1>
<form action="" method="GET">
<label for="qq">QQ号码:</label>
<input type="text" name="qq" id="qq" required>
<button type="submit">查询</button>
</form>
<?php
if(isset($_GET['qq'])) {
$qq = $_GET['qq'];
$url = "https://v.api.aa1.cn/api/api-qq-gj/index.php?qq=$qq";
$data = file_get_contents($url);
$result = json_decode($data, true);
if($result['code'] == 1) {
echo "<table>";
echo "<tr><th>QQ号码</th><td>{$result['qq']}</td></tr>";
echo "<tr><th>价格</th><td>{$result['money']}</td></tr>";
echo "<tr><th>等级</th><td>{$result['dengji']}</td></tr>";
if($result['vip'] == 1) {
echo "<tr><th>VIP会员</th><td>否</td></tr>";
} else {
echo "<tr><th>VIP会员</th><td>是</td></tr>";
}
echo "</table>";
} else {
echo "<p>查询失败,请重新输入QQ号码</p>";
}
}
?>
</body>
</html>
原文地址: http://www.cveoy.top/t/topic/M3F 著作权归作者所有。请勿转载和采集!