我的短信代码:我从第三方购买了短信门。当我整合到我的网站时,我遇到了一些问题。我列出了我的问题。任何人都可以指导我进一步做些什么?阅读我的问题?
<?php
$ID = 'xxxxxx';
$Pwd = 'xxxxx';
$PhNo = '1234567890,123456789';
$Text = 'welcome to US';
$url="http://t.dialmenow.info/sendsms.jsp?user=$ID&password=$Pwd&mobiles=$PhNo&sms=$Text&senderid =";
//echo $url;
$ret = file($url);
//echo $ret;
echo $ret[9];
?>
**I have problem with my message and delivery report.**
1.If you see the $Text variable $Text=welcome to US if I give space after first word the message is not coming to my mobile.
2.In api documentation they have given how to check delivery status. Here is the api delivery status code.they have given sample code. I want to know how to write the sample delivery status code for above php code.
http://t.dialmenow.info/getDLR.jsp?userid=username&password=password&messageid=1,2&externalid=1,2 &drquantity=X&fromdate=yyyy-mm-dd hh:mm:ss&todate=yyyy-mm-ddhh:mm:ss&redownload=yes&responcetype=xml
Explanation:
messageid=>When you send a message you will get an unique message id from API and you have to use this
messageid=>for getting the deliver status for that message.
externalid=>unique sms serial no which you will get in response.
Drquantity=>it means how many delivery status you want from Dialmenow application
答案 0 :(得分:0)
尝试使用以下信息对邮件进行编码 $ msg = urlencode($ Text)
没有使用file(),但您可以尝试通过cURL实现。请确保在将要执行代码的服务器中安装cURL。
$ID = 'xxxxxx';
$Pwd = 'xxxxx';
$PhNo = '1234567890,123456789';
$Text = 'welcome to US';
$msg=urlencode($Text);
$url="http://t.dialmenow.info/sendsms.jsp?user=$ID&password=$Pwd&mobiles=$PhNo&sms=$msg&senderid=";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER ,true);
$result = curl_exec($ch);
curl_close($ch);