gann1 0 Newbie Poster

Sending SMS through gateway was one of the features in our project.
In our first tries, the complete message was succeefully sent.. We used this Code

<?php
 header("location:http://api.clickatell.com/http/sendmsg?user=thisistheusername&password=thisisthepassword&api_id=thisistheapiid&to=". $_POST['mnumber'] ."&text='". $_POST['message'] ."'");

?>

But our panelists required us to put an alert that the message was sent..
and when we used this code,

<?php
  $url = "http://api.clickatell.com/http/sendmsg?user=thisistheusername&password=thisisthepassword&api_id=thisistheapiid&to=". $_POST['mnumber'] ."&text='". $_POST['message'] ."'";
  $data = file($url);

  $dataArr = explode(":",$data[0]);
 if ($dataArr[0] == "OK") 
  {
echo "<script>";
echo 'alert("Failed")';
echo "</script>";
  } 
  else 
  {
 echo "<script>";
echo 'alert("Message was successfully sent.")';
echo "</script>";
}
  echo "<script>setTimeout(\"location = 'sendsms.php';\",10)</script>";
?>

only the first word of the message was sent..
Whats wrong? What should we do?