【发布时间】:2013-06-26 19:43:20
【问题描述】:
我有这个问题。 我在这里使用这个脚本来发送一条自动短信:
<?php
function get_data($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$returned_content = get_data('http://url.goes.here:8080/bulksms/bulksms?username=user&passwd=password&type=0&dlr=1&destination=phone&source=FLM&message=hello');
?>
问题是,如果我直接提交 URL,我会得到类似:
1701|355662080090|a2406d38-1baf-42a2-a1a5-e5798859e400
我的手机收到一条短信,但如果我使用上述方法,我将收不到短信.. 任何人都可以建议我为什么会这样? 谢谢..
【问题讨论】:
-
所以
file_get_contents("http://url.goes.here:8080/bulksms/bulksms?username=user&passwd=password&type=0&dlr=1&destination=phone&source=FLM&message=hello")不起作用?可能是因为allow_url_fopen被禁用了? -
你能帮我解决这个问题吗?它不依赖于禁用或启用的功能..
-
问题是,它是一个外部站点,我没有权限,我无法启用或禁用功能
-
ini_get('allow_url_open');的输出是什么? -
@al_alb:另外,我们在 您的 网站中谈论
allow_url_fopen。
标签: php curl file-get-contents