写着玩玩.....
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(); }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。