php curl错误:无法解析主机

时间:2015-03-31 16:59:38

标签: php curl

您好我正在尝试通过我的短信api发送短信它以前工作正常但是当我改变我的api链接时它开始给我错误 这是我的代码

$url = "http://vas.mobilogi.com/api.php?";

$message = urlencode($message);
$ch = curl_init();

if (!$ch) {
    die("Couldn't initialize a cURL handle");
}

$ret = curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POSTFIELDS, "username=$user&password=$password&sender=$senderid&to=$mobilenumbers&message=$message&response='Y'&unicode='Y'");

0 个答案:

没有答案
相关问题