1

我正在尝试设置 SMS 系统并使用 aql.com 发送文本(SMS)消息。

这在浏览器中工作正常: http ://gw1.aql.com/sms/postmsg.php?to_num=447943417499&message=HELLO&flash=0&originator=Me&username=&密码= ***

前几天晚上,我使用一个简单的 header() 函数让它在 PHP 中工作。我现在无法让它与 header、ob_start/flush、fsock 等一起使用。

在这种情况下发送 GET 请求的最佳和可靠方法是什么。我可以举一个基本的例子吗?

提前致谢, :-)

[编辑] 收到短信后通过 SMS 提供商请求该页面,因此调试非常困难,尤其是在共享主机上!

4

2 回答 2

2

首先这里有这项服务的梨

这里还有另一个实现:

function dosmsend($number, $message, $flash = "") {
    // your aql username and password
    $username = "yourusername";
    $password = "yourpassword";

    $weburl = "http://gw1.aql.com/sms/postmsg.php";

    // encodes your message for sending on the web
    $message = urlencode($message);


    // the request string
    $smsurl = "$weburl?username=$username&password=$password&to_num=$number&message=$message";


    // if $flash is set to 1, it will add the flash request onto the query
    if ($flash == "1")
        $smsurl .= "&flash=1";

    // connects to server to send message
    if ($content_array = file($smsurl)) {
        $content = implode("", $content_array);

        // check for response
        if (eregi("AQSMS-AUTHERROR", $content))
        echo "There was an authenication error";
        elseif (eregi("AQSMS-NOMSG", $content))
        echo "There was no message or mobile number";
        elseif (eregi("AQSMS-OK", $content))
        echo "The Message was queued succcessfully";
        elseif (eregi("AQSMS-NOCREDIT", $content))
        echo "Your account has no credit";
    }
    else
        echo "There was an error connecting to the server";
}

dosmsend("09978123456", "this is a test message");

//or 
//dosmsend("09978123456","this is a test flash message oo!","1");
于 2012-11-22T17:32:46.403 回答
0

对于大多数业务场景,应尽量减少与第三方的交易,因为您希望尽可能多地控制自己的运营,除非涉及联属网络营销业务和通过这些程序致富的概念。

于 2013-01-11T05:44:41.497 回答