用php写成查询代码 需要有样式接口地址:httpsvapiaa1cnapiapi-qq-gjindexphp返回格式:JSON请求方式:GET接口名称 接口类型 接口说明code string 1:返回正常0:返回错误qq string qq号码money string qq价格dengji string qq等级vip string 1:非会员2:会员
<!DOCTYPE html>
<html>
<head>
<title>查询QQ信息</title>
<style type="text/css">
table{
border-collapse: collapse;
width: 100%;
margin-top: 20px;
}
table th, table td{
border: 1px solid black;
padding: 10px;
text-align: center;
}
form{
margin-top: 20px;
text-align: center;
}
input[type="submit"]{
padding: 10px 20px;
font-size: 16px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
input[type="text"]{
padding: 10px;
font-size: 16px;
border: 1px solid black;
border-radius: 5px;
margin-right: 10px;
}
.error{
color: red;
font-size: 18px;
margin-top: 20px;
text-align: center;
}
</style>
</head>
<body>
<form method="GET" action="https://v.api.aa1.cn/api/api-qq-gj/index.php">
<label for="qq">输入QQ号码:</label>
<input type="text" id="qq" name="qq" required>
<input type="submit" value="查询">
</form>
<pre><code><?php
if(isset($_GET['qq'])){
$url = "https://v.api.aa1.cn/api/api-qq-gj/index.php?qq=" . $_GET['qq'];
$data = file_get_contents($url);
$result = json_decode($data, true);
if($result['code']==1){
echo '<table>';
echo '<tr><th>QQ号码</th><th>价格</th><th>等级</th><th>VIP</th></tr>';
echo '<tr><td>' . $result['qq'] . '</td><td>' . $result['money'] . '</td><td>' . $result['dengji'] . '</td><td>' . ($result['vip']==1 ? '非会员' : '会员') . '</td></tr>';
echo '</table>';
}else{
echo '<p class="error">' . $result['msg'] . '</p>';
}
}
?>
</code></pre>
</body>
</html>
原文地址: http://www.cveoy.top/t/topic/M3g 著作权归作者所有。请勿转载和采集!