Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6691561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:45:58+00:00 2026-05-26T05:45:58+00:00

I am writing an sms application that retrieves the messages from a MYSQL database

  • 0

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 :

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

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:

            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%

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

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

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:

              <?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);

          ?>

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:

    $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));
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:45:58+00:00Added an answer on May 26, 2026 at 5:45 am

    Change

          $url = "http://localhost/sms/index.php?name=".$name;
    

    To

          $url = "http://localhost/sms/index.php?name=".urlencode($name);
    

    You can try with rawurlencode() as well

    UPDATE
    Since now you get the data, but not the full, it seems that the problem is not in the curl anymore, but on the script you are sending the request to (localhost/sms/index.php).
    Keep in mind that SMS is limited in size, and that can be the reason the data is truncated. Anyway, without look at index.php, we cannot tell why you are not receiving the data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an application to receive SMS messages via an HTTP gateway. The main
I writing some simple application that will look for some message ( sms message
Writing an iPhone app, and I'm getting my data from a REST API that
I am writing my own SMS application that will display a toast of my
I'm writing an app for WM that handles incoming SMS events. I tried making
I'm writing some sms application for android and i have a problem. I send
Writing my first silverlight application. I need to deliver some bitmap that the customer
I am interested in writing an app that will intercept an outgoing SMS message
I'm writing an app that sends sms using SmsManager. How can I get informations
I am interested in writing a simple CLI program that will send an SMS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.