调用webservice接口实现几个查询
发布时间:2020-12-16 22:38:22 所属栏目:安全 来源:网络整理
导读:写着玩玩..... 1. 查询手机号码归属地 htmlheadtitle查询手机号码归属地/titlemeta charset = 'utf-8' /headbodyform action = 'Mobilephone.php' method = 'POST'b请输入正确的手机号进行查询.../binput type = 'text' name = 'code' /input type = 'submit
写着玩玩..... 1. 查询手机号码归属地
<html> <head> <title>查询手机号码归属地</title> <meta charset = 'utf-8'> </head> <body> <form action = 'Mobilephone.php' method = 'POST'> <b>请输入正确的手机号进行查询...</b> <input type = 'text' name = 'code' /> <input type = 'submit' name = 'submit' value = '查询'> </form> </body> </html> <?PHP ERROR_REPORTING(0); $code = $_POST['code']; if($_POST['submit']){ $soapclient = new SoapClient('http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl'); $result = $soapclient -> getMobileCodeInfo(array('mobileCode' => $code)); foreach($result as $key => $value){ echo $value; } header("content-type:text/html;charset = utf-8"); $soapclient -> __getLastRequest(); } 2.查询QQ是否在线
<html> <head> <title>查询QQ是否在线</title> <meta charset = 'utf-8'> </head> <body> <form action = 'qqonline.php' method = 'POST'> <b>请输入要查询的QQ号...</b> <input type = 'text' name = 'qqCode' /> <input type = 'submit' name = 'submit' value = '查询'> </form> </body> </html> <?PHP ERROR_REPORTING(0); $qqCode = $_POST['qqCode']; if($_POST['submit']){ //wsdl是webservice方法的规格说明书 $soapclient = new SoapClient('http://webservice.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl'); $result = $soapclient -> qqCheckOnline (array('qqCode' => $qqCode)); foreach($result as $key => $value){ switch ($value){ case Y: echo '在线'; break; case N: echo '离线'; break; case E: echo 'QQ号码错误'; break; case A: echo '商业用户验证失败'; break; default: echo '免费用户超过数量'; break; } } header("content-type:text/html;charset = utf-8"); $soapclient -> __getLastRequest(); } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |