How to send a generic SMS using Kannel
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);
精彩评论