0

我已经尝试运行这个 sript 好几个星期了。

我想要的是将数据发送到那里显示的服务器并返回服务器响应,但我从响应中得到的只是 url 但 url 没有执行它只会显示在响应 var

<?php
class send
{

    public $username;
    public $password;
    public $destination;
    public $sender;
    public $msg;
    public $type;
    public $dlr;
    public $url;

    function __construct()
    {
    }

    function send_sms(){
        $posturl = 'http://121.241.242.114:8080/bulksms/bulksms?';
        $number = $this->destination;

        $msg = urlencode($this->msg);
        $type='0';
        $dlr='1';
        $url='';
        $posturl = $posturl."source=".$this->sender."&username=".$this->username."&password=".$this->password."&type=".$type."&dlr=".$dlr."&destination=".$number."&message=".$msg;
        $ch = curl_init(); 
        curl_setopt($ch, CURLOPT_URL, $posturl); 
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
        curl_setopt($ch, CURLOPT_POST, true);
        $response = curl_exec($ch); 
        return $posturl;
    }

}
?>
4

1 回答 1

0
return $response; //and not $posturl
于 2012-12-13T09:22:30.180 回答