Search code examples
phpkannel

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


Solution

  • Try using urlencode():

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