cURL still Truncates Data...even with url encode
<p>I am writing an sms application that retrieves the messages from a MYSQL database and uses cURL to pass the messages  to the smpp api of an sms gateway.I discovered a minor hitch with cURL...in the sense that the messages were being truncated.I got the application to add more data by using urlencode for the variable i was transferring...however some data was still being truncated.I was told it might be because of the length of the "GET" request..however i believe the only way to access the api of the sms gateway is via a "GET" request...based on what i was given..which is :</p>

<pre><code>               http://xxx.yyy.zzz.qqq:8080/bulksms/bulksms?username=
               bbb&amp;password=demo&amp;type=0&amp;dlr=Z&amp;destination=806754367
               &amp;source=TESTING&amp;message=hi testing
</code></pre>

<p>The  purpose of this application is to send academic reports of students to their guardians...so the request has to be lengthy.An average record taken from the table looks like this:</p>

<pre><code>            The Results For Your Son Pedro Have Been Released As Follows: 
           Mathematics:97% English Language:58% Crk:59% Social Studies:67% 
           Commerce:67% Government98% Biology: 100% Chemistry:78% Geography:99% 
           Religious Knowledge:Did Not Register
           Economics:54%
</code></pre>

<p>When i transferred  the records for a test run with curl,this is what i got:</p>

<pre><code>  The Results For Your Son Pedro Have Been Released As Follows:
   Mathematics:97% English Language:58% Crk:59% Social Studi
</code></pre>

<p>So my concern is to get the "COMPLETE" record and then send it to the sms gateway api.My revised code with the urlencode function is:</p>

<pre><code>              &lt;?php

            include 'sms_connect.php';
            $sql="select name from sms";
           $result=mysqli_query($link,$sql) or die("Error in sms".mysqli_error($link));
           while($row=mysqli_fetch_assoc($result))
            {$name=$row['name'];
            $url = "http://localhost/sms/index.php?name=".urlencode($name);
            $ch = curl_init();
             curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_HEADER, 0);

       // grab URL and pass it to the browser
         $results = curl_exec($ch);
         var_dump($results);

           }

     curl_close($ch);

          ?&gt;
</code></pre>

<p>Ok...technical support person for the sms gateway said that with the smpp protocol..large amounts of data can be sent..i intend to experiment and abbreviate the data as appropriate.
My index.php code is shown below:</p>

<pre><code>    $name=$_GET['name'];
    include 'sms_connect.php';
    $sql="insert into sms_test values('$name')";
    $result=mysqli_query($link,$sql) 
     or die("Error in inserting name".mysqli_error($link));
</code></pre>
