PHP 代码文件:sms1.php 位于http://techmentry.com/sms1.php(请访问链接并查看以下代码的输出)。
<?php
//Variables to POST
$user = "HIDDEN";
$password = "HIDDEN";
$mobiles = "919999999999";
$message = "test";
$sender = "HIDDEN";
//Initialize CURL data to send via POST
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://example.com/example.php");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "user=$user&
password=$password&
mobiles=$mobiles&
message=$message&
sender=$sender"
);
//Execute CURL command and return into variable $result
$result = curl_exec($ch);
//Do stuff
echo "$result"
?>
我期望的输出是:上面的代码应该处理这个 URL:URL HIDDEN,然后返回一个消息 ID 或适当的错误代码。
但是我得到的输出超出了我的预期!甚至没有错误日志。请帮我 :)