Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> msxml3.dll<br/><b>Description:</b> The URL does not use a recognized protocol ' in D:\phpnow\htdocs\mobile_messages\Send_Test.php:14 Stack trace: #0 D:\phpnow\htdocs\mobile_messages\Send_Test.php(14): com->open('GET', ' http://web.mob...', false) #1 {main} thrown in D:\phpnow\htdocs\mobile_messages\Send_Test.php on line 14
请各位大侠帮忙想想啊!
请各位大侠帮忙想想啊!
/*根据参数,生成调用URL,因为是测试例子,不对变量为空的情况做处理*/
$URL = "http://web.mobset.com/SDK/Sms_Send.asp?CorpID=".$_POST['CorpID']."&LoginName=".$_POST['LoginName']."&send_no=".$_POST['send_no']."&Timer=".$_POST['Timer']."&msg=".rawurlencode($_POST['msg'])&passwd=".$_POST['passwd'].";/*调用MSXML,发送请求*/
$objHttpRequest=new COM("MSXML2.ServerXMLHTTP");
if (is_null($objHttpRequest)) {
echo "create Msxl2.ServerXMLHTTP error";
exit();
}
$objHttpRequest->open("GET",$URL,False);
$objHttpRequest->send();
if ($objHttpRequest->status <> 200) {
/*返回错误*/
echo "open Request error";
exit();
}
/*取返回的信息,并分析*/
$retMsg=$objHttpRequest->responseText;
$Ret=strtok($retMsg,",");
$iRet=intval($Ret);/*判断是否发送成功*/
if ($iRet>0) {
$SendID=substr($retMsg,-(strlen($retMsg)-strlen($Ret)-1));
echo "发送短信成功,SmsID:". $SendID;
}
else {
echo "发送短信失败,错误代码:" . $iRet;
}
/*释放对象*/
$objHttpRequest=NULL;
?>这是代码