开发者

How to send a generic SMS using Kannel

开发者 https://www.devze.com 2023-02-26 01:54 出处:网络
I开发者_运维问答 use this Method, and it works fine $url = \"http://localhost:13013/cgi-bin/sendsms?username=tester&password=foobar&to=\".$number.\"&text=Send\";

I开发者_运维问答 use this Method, and it works fine

$url = "http://localhost:13013/cgi-bin/sendsms?username=tester&password=foobar&to=".$number."&text=Send";
$urloutput=file_get_contents($url);

now it doesn't work when i concatenate $text to the text parameter!

$url = "http://localhost:13013/cgi-bin/sendsms?username=tester&password=foobar&to=".$number."&text="." ".$text."lol'";

I'm not sure if this is a kannel issue or php issue ! since concatenating $number works just fine ! I'm using CakePHP 1.3 on Linux and Xampp


Try using urlencode():

$url = "http://localhost:13013/cgi-bin/sendsms?username=tester&password=foobar&to=".$number."&text=".urlencode($text);
0

精彩评论

暂无评论...
验证码 换一张
取 消