写着玩玩.....
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();
}