我的代码是
<?php
if ($_POST['hiddensms']) {
ini_set("allow_url_fopen", "ON");
ini_set("allow_url_include", "ON");
$smsno = explode(',', $_POST['hiddensms']);
foreach ($smsno as $mono) {
$baseurl = "http://api.xxxxxxxxxxxx.com";
$sql_q = "select firstname,lastname from tbl_newsletter where phone='" . $mono . "'";
$resultcount = mysql_query($sql_q);
$row_total_count = mysql_fetch_array($resultcount);
$first_name = $row_total_count['firstname'];
$last_name = $row_total_count['lastname'];
if ($_POST['sel_name_sms'] == 'FirstName') {
$setname = $first_name;
} else {
$setname = $last_name;
}
$smsBodyText = $_POST['sal_sms'] . ' ' . $setname . '\n';
$text = urlencode($smsBodyText . $_POST['msg_body']);
$to = $mono;
$url = "$baseurl/http/auth?user=$user&password=$password&api_id=$api_id";
// do auth call
$ret = file($url);
// explode our response. return string is on first line of the data returned
$sess = explode(":", $ret[0]);
if ($sess[0] == "OK") {
$sess_id = trim($sess[1]); // remove any whitespace
$url = "$baseurl/http/sendmsg?user=xx&password=xxxxx&api_id=3370743&to=$to&text=$text";
//ht$ret = file($url);
$send = explode(":", $ret[0]);
if ($send[0] == "ID") {
echo "success\nmessage ID: " . $send[1];
} else {
echo "send message failed";
}
} else {
echo "Authentication failure: " . $ret[0];
}
}
}
?>
我正在尝试通过 api 发送短信,但给了我这个错误
警告:file() [function.file]:在第 622 行 /xxxxxxxsubscriber-list.php 的服务器配置中禁用 URL 文件访问警告:file(http://api.xxxxx.com/http/auth?user =xx&xx&api_id=xx) [function.file]:打开流失败:在第 622 行的 /xxxxxx/subscriber-list.php 中找不到合适的包装器 身份验证失败:
我设置 .htaccess 喜欢
<IfModule mod_php5.c>
php_admin_value allow_url_fopen On
php_admin_value allow_url_include On
</IfModule>
但它不工作。我不知道该怎么办,如果有任何想法,请帮助我
我在他们建议的一些网站上搜索了 php.ini
allow_url_fopen = On
allow_url_include = On
但我无法访问php.ini
,所以还有其他方法可以解决这个问题吗?