我的PHP代码(free.php)是网址编码错误?在<a href="http://techmentry.com/free.php" rel="nofollow">http://techmentry.com/free.php</a>
<?php
{
//Variables to POST
$access_token = "b34480a685e7d638d9ee3e53cXXXXX";
$message = "hi";
$send_to = "existing_contacts";
//Initialize CURL data to send via POST to the API
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://freesmsgateway.com/api_send");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
array('access_token' => $access_token,
'message' => urlencode('hi'),
'send_to' => $send_to,)
);
//Execute CURL command and return into variable $result
$result = curl_exec($ch);
//Do stuff
echo "$result";
}
?>
我收到此错误:该消息是空白的
这个错误的意思是:“消息栏是空白的或不正确的URL编码“(正如我的短信网关所说)。但正如你所看到的,我的信息栏不是空白的。