0

这是我的 sendmsg 编码页面。我对吗?它不工作。首先我遇到了致命错误:调用未定义的函数 curl_init()。我清除了那个错误。现在加载 10 到 15 秒并在该页面中显示错误需要时间。编码如下...

$name = $_POST['name'];
$connum = $_POST['connum'];
$email = $_POST['email'];
$msg = $_POST['msg'];
$msg = "$name $connum $email";
$from = "FROM";
$to = "9876543210";
$username = "xxx";
$password = "yyy";
$hash = "RjK=H4kL";
$formcountry = "91";
$sourceinfo = "1";
$url = "http://absolutesms.com/Sendsms.aspx";
$fields = array ( 'from'=>urlencode($from), 'to'=>urlencode($to), 'username'=>urlencode($username), 'password'=>urlencode($password), 'hash'=>urlencode($hash), 'formcountry'=>($formcountry), 'sourceinfo'=>($sourceinfo) );
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
$result = curl_exec($ch);
if(!$result)
{
    echo "Error";
}
else
{
    echo "Message Sent Successfully";
}
curl_close($ch);
4

2 回答 2

3

您尝试访问的网站http://absolutesms.com/似乎已关闭。DNS似乎可以解析,但无法访问。

于 2013-10-04T13:23:02.927 回答
0

您的开发或 Web 服务器没有安装或启用 curl,请参阅下面的 php.net 链接以获取设置此英国的更多信息。

http://www.php.net/manual/en/curl.setup.php

于 2013-10-04T13:21:47.227 回答