这是我的 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);