Technology Blog





Monday, October 31, 2011

Create Free SMS app using PHP, JSON API, cURL and txtWeb

The current period is SMS era. Where in just 140 character made twitter dominate the social media. We are used to have everything right now as "Short and Sweet".

In India Short Messaging Service is one of the most important mode of communication today, which gave birth to lot of Start ups concentrate on SMS based solutions. is one such website which provide more than 1000+ apps to choose for free of cost in India, USA & Canada.
Just type keyword for the service you are looking for and SMS it to 92433 42000 in India and 650.385.8882 in US and Canada.

The eagerness to make an SMS App drive me crazy so i felt it would help you too from this tutorial.

Step 1
Register at

txtWeb - Registration

Step 2

txtWeb - Welcome

Step 3
Verify the email inbox to activate your developer account


Step 4
There are two ways of creating SMS App here, in order to answer the dynamic input as SMS choose "Create txtApp"
Step 5
Enter the details of your FREE SMS application, the path is your web space where the below php script is to be uploaded via FTP.
Step 6
Test the SMS APP before publishing. We may make use of Emulator provided by them or our mobile phone

Click on Edit to get the Application Key

Step 7
Get the Application key and use it in the code where every needed
Step 8
Get the API KEY from with the help of our previous post "finding the Real IP address details"
< ?php
* GetIpDetails
* Author : S.MohanKumar
* IP API from
* SMS from
* Date : 1/Nov/2011 4:00AM IST
echo "<html>
<meta name="txtweb-appkey" content="">
if(isset($_GET['txtweb-message'])) $realIp = $_GET['txtweb-message'];
if(filter_var($realIp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
$ipDetails_json =GetIpDetails($realIp);
$obj = json_decode($ipDetails_json);
echo "IPaddress : ".$obj->{'ipAddress'}."<br />"; // IpAddress
echo "Country name : ".$obj->{'countryName'}."<br />"; // countryName
echo "State name : ".$obj->{'regionName'}."<br />"; // regionName
echo "City name : ".$obj->{'cityName'}."<br />"; // cityName
echo "Latitude : ".$obj->{'latitude'}."<br />"; // latitude
echo "Longitude : ".$obj->{'longitude'}."<br />"; // longitude
echo "Time zone : ".$obj->{'timeZone'}."<br />"; // timeZone
else {
echo "Sorry Invalid IP address! Try again<br />@IpInfo Valid-IP";
function GetIpDetails($realIp){
//check if you have curl loaded
if(!function_exists("curl_init")) die("cURL extension is not installed");
// create a new cURL resource
$ch = curl_init();
// API Key
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HEADER, false);
// grab URL and pass it to the browser
// close cURL resource, and free up system resources
return $ipDetails_json;
echo "</body>
Copy this code and upload into the web server path stated in Step 5 in input field "I want to enter an AppSite URL"

Step 9
Now Test the Application with Emulator provided by


Step 10
Enter inside the emulator as

The Output Will be like this.

SMS to 9243342000 (from India)
@IpInfo ValidIpaddress
Eg. @IPInfo


  1. Internet web marketing can make the world your oyster, that is, if you have a good plan, preparation and persistence in mind.

  2. Thanks for sharing this information. It is very easy process to create sms api php apps etc..

  3. I enjoyed over read your blog post. Your blog have nice information, I got good ideas from this amazing blog. I am always searching like this type blog post. I hope I will see again app development in dubai

  4. That seems very nice! I am going to launch my business soon so was just looking for being text messaging service for business. And I think that such an app is also going to be a good option to run the bulk SMS campaign with an ease! Looking forward to more such posts here!