QQ查询信息php,查询QQ信息

# :-: 介绍

* 目前只能查询的有:QQ昵称、QQ头像、QQ邮箱。

* 接口有时会不稳定,但一旦出现问题,我们技术人员会第一时间进行维修!

# :-: 代码说明

* 本接口采用GET和POST方式提交,JSON返回方式返回信息。

* 提交地址:`https://api.berfen.com/api/qqcx.php`

## :-: 在线测试

* 测试QQ:1406094144

* 测试链接:[https://api.berfen.com/api/qqcx.php?qq=1406094144](https://api.berfen.com/api/qqcx.php?qq=1406094144)

## :-: 提交参数说明

| 参数 | 示例 | 说明 |

| --- | --- | --- |

| GET/POST | | 提交方式为get和post |

| qq | 1406094144 | 查询的QQ |

## :-: 返回参数说明

| 参数 | 示例 | 说明 |

| --- | --- | --- |

| JSON |{"code":200,"msg":"OK","qq":"1406094144","nc":"昵称","yx":"1406094144@qq.com","tx":"http://q1.qlogo.cn/g?b=qq&nk=1406094144&s=100&t=1547904810"}| 返回方式为json数据 |

| code | 200 | 返回判断,200就是成功,其他的数字就是失败 |

| msg | | 返回信息,返回成功的信息和失败的原因 |

|qq| 1406094144 | 查询的QQ号 |

|nc|昵称|查询的昵称|

|yx|1406094144@qq.com|查询的邮箱|

|tx|http://q1.qlogo.cn/g?b=qq&nk=1406094144&s=100&t=1547904810|查询的头像|

## :-: iApp代码示例

~~~

t()

{

ug(1,"text",qq)

//获取编辑框ID为1的内容,就是QQ号

ss("https://api.berfen.com/api/qqcx.php?fs=json&qq="+qq,url)

//组合数据

hs(url,url)

json(url,url)

json(url,"get","code",pd)

//截取判断信息

f(pd=='200')

{

json(url,"get","qq",qq)

//获取QQ

json(url,"get","nc",nc)

//获取昵称

json(url,"get","yx",yx)

//获取邮箱

json(url,"get","tx",tx)

//头像链接

ufnsui()

{

//更新线程,设置内容

us(2,"text",qq)

//将QQ设置到文本控件的ID为2上

us(3,"text",nc)

//将昵称设置到文本控件的ID为3上

us(4,"text",yx)

//将邮箱设置到文本控件的ID为4上

us(5,"url",tx)

//将头像图片链接设置到浏览器控件ID为5上(当然,您可以选择将图片下载到手机再使用)

}

}

else

{

json(url,"get","msg",ts)

//截取返回信息

ufnsui()

{

tw(ts)

//弹出信息

}

}

}

~~~

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要实现QQ邮箱验证,可以使用PHP编程语言进行操作。下面是一个使用PHP验证QQ邮箱的示例代码: ```php <?php // 获取用户输入的邮箱地址 $email = $_POST['email']; // 正则表达式验证邮箱格式 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { // 邮箱格式不正确 echo "邮箱格式不正确"; } else { // 使用SMTP协议连接QQ邮箱服务器 $smtpServer = "smtp.qq.com"; $username = "your_qq_email@qq.com"; // QQ邮箱账号 $password = "your_password"; // QQ邮箱密码 try { $smtpConnection = fsockopen($smtpServer, 25, $errno, $errstr, 5); if (!$smtpConnection) { throw new Exception($errstr, $errno); } // 响应码验证 $response = fgets($smtpConnection, 515); if (substr($response, 0, 3) != "220") { throw new Exception("连接服务器失败"); } // 发送验证命令 fputs($smtpConnection, "HELO $smtpServer\r\n"); $response = fgets($smtpConnection, 515); if (substr($response, 0, 3) != "250") { throw new Exception("HELO命令发送失败"); } fputs($smtpConnection, "AUTH LOGIN\r\n"); $response = fgets($smtpConnection, 515); if (substr($response, 0, 3) != "334") { throw new Exception("AUTH LOGIN命令发送失败"); } // 发送邮箱账号 fputs($smtpConnection, base64_encode($username) . "\r\n"); $response = fgets($smtpConnection, 515); if (substr($response, 0, 3) != "334") { throw new Exception("用户名发送失败"); } // 发送邮箱密码 fputs($smtpConnection, base64_encode($password) . "\r\n"); $response = fgets($smtpConnection, 515); if (substr($response, 0, 3) != "235") { throw new Exception("密码发送失败"); } // 发送目标邮箱地址 fputs($smtpConnection, "MAIL FROM: <$email>\r\n"); $response = fgets($smtpConnection, 515); if (substr($response, 0, 3) != "250") { throw new Exception("MAIL FROM命令发送失败"); } // 处理验证结果 $result = $response == "250 OK\r\n" ? "邮箱验证通过" : "邮箱验证失败"; echo $result; // 关闭连接 fputs($smtpConnection, "QUIT\r\n"); fclose($smtpConnection); } catch (Exception $e) { echo $e->getMessage(); } } ?> ``` 首先,通过正则表达式验证用户输入的邮箱格式是否正确。然后,使用SMTP协议连接QQ邮箱服务器,并发送验证命令,包括验证邮箱账号、密码和目标邮箱地址。根据服务器的响应,可以判断邮箱验证是否通过。最后,关闭与服务器的连接。 请注意,代码中的“your_qq_email@qq.com”和“your_password”需要替换为你自己的QQ邮箱账号和密码。另外,由于使用SMTP协议需要与邮件服务器进行交互,因此需要确保服务器上已开启相关的网络端口。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值