Text message has widely usage via cell phone. In this article we will show you in steps that how we can setup SMS gateway using our cell phone. Once we are done then we will be able to send/recieve text message on the web.
Here is our initial requirement, what we need before setting up free SMS gateway:
1. A computer, we use the OS Windows XP. I use Win XP on laptop Byon Centrino Duo, 2G RAM.
2. A gsm modem or mobile phone that can work as a gsm modem. I use Sony Ericsson K750i with the number IM3
3. Cable or bluetooth connection to the HP computer. I’m using the cable that comes with SE K750i
4. Driver mobile phone or PC suite; the author using the PC suite that is available in the sales package SE K750i
5. A mobile phone to send sms; I’m using Motorolla W150i with a number Fren
6. A software as a gateway. I use nowsms
7. Apache, MySQL and PHP; I use appserv 2.5.7
The first step is to install appserv on our computer.
1. Test in the browser by typing http://localhost, is already showing? If already showing some webpage, means Webserver webserver is already setup.
2. Type the test again next http://localhost/phpmyadmin. If it means that PHP is the way and MySQLnya already functioning well
Step two is to connect the phone to the computer. Do not forget to install the driver or HP’s PC Suite. Make sure the computer and HP already well connected.
Step three is to install NowSMS. File installer Now SMS / MMS gateway is comon 7.42 MB and can be easily downloaded in http://www.nowsms.com. Software is paid but we can try for free and full functionality for 60 days.
Once we install we will get interface like this:
Four step is to add a modem gsm / HP :
1. click Add
2. Select Phone or GSM modem and click OK
Select the modem and we fill pin, the SE default PIN is 1234. Click Test and add a modem. If any posts appear successful modem successfully tested!
Step five is to setting up SMSC connection:
1. Click on the menu at the top of the SMSC
2. SMSC connection you select, these cases are added is the new Sony Ericsson 750 USB WMC Modem.
I want to add other devices to stay a step to follow the four
3. Click properties and fill in the phone number in the modem / HP SE K750i (in this case the number IM3)
4. check receive SMS Messages
5. Click OK
Step six is to run the SMS gateway service:
1. Click Service in the menu on the nowsms program.
2. Sms gateway then check run as a service.
3. You will dimintai approval and nowsms will restart itself automatically to run as a service.
following SMS picture which is now functioning as a service:
Step seven is to try to send sms through the web interface:
1. By default sms now running on the localhost or the ip address 127.0.0.1 with port 8800
2. We open a browser and type the following address: http://localhost:8800
3. interface will appear like this:
4. Fill Text and phone number and click submit
5. Now you have sent the SMS to the recipient’s number
Are you satisfied now with this? I’m not though. Let us now connect the sms with PHP and MySQL. (But sorry, I make a cup of tea first with Samosa. Hungry …)
Now connect the sms / mms gateway with PHP and MySQL:
SMS will be sent later with the W150i phone that functions as an sms. HP and received K750i (gsm modem) is forwarded to the computer that received sms gateway sms now and then forwarded to the php script. PHP script and then proceed to save the MySQL database.
The first step is to create a database with the name mysql nowsms
1. http://localhost/phpmyadmin type in the browser to open phpmyadmin
2. type the name of the database, here we paka name nowsms
# And enter the sql code to create this table with the name of the inbox column consists of 2 ps and the contents
view plain print
2. CREATE TABLE `inbox` (
3. `id` int (5) NOT NULL auto_increment,
4. `content` text NOT NULL,
5. PRIMARY KEY ( `id`)
6. ) Engine = MyISAM default charset = UTF8 AUTO_INCREMENT = 4;
CREATE TABLE `inbox` ( `id` int (5) NOT NULL auto_increment, `content` text NOT NULL, PRIMARY KEY ( `id`)) engine = MyISAM default charset = UTF8 AUTO_INCREMENT = 4;
# Following data structures …. (sorry bgt simple to facilitate the understanding of …)
Step two is to create a PHP script which include sms to MySQL database
1. open windows explorer to create a new directory with the name nowsms
2. What’s the author URL is C: AppServwwwnowsms
3. and create a index.php file with the name of the contents as follows:
view plain print
2nd / / Database settings
3. $ DB_Host = “localhost”;
4. $ db_user = “root”;
5. $ db_pass = “sipit”;
6. $ db_name = “nowsms”;
8. / / Connect to the database
9. $ link = mysql_pconnect ($ DB_Host, $ db_user, $ db_pass) or die ( “I can connect”);
10. mysql_select_db ($ db_name) or die ( “I can select the database”);
12. / / Trim inputan. This also eliminates the problem does not
13. $ content = trim ($ content);
15. / / insert to table inbox
16. $ sql = “INSERT INTO inbox
17. SET id =”,
18. content = ‘$ content’ “;
19. $ query = mysql_query ($ sql);
4. Complete (do not forget extensinya is *. php so if the notepad select save as typenya as all the files, and give the name of index.php)
step three is to set the settings in sms now
1. Select 2-Way in the top menu
2nd Check process received sms message
3. The contents of SMS command prefix with an asterisk * or Asterix or (*_*;)
mean all sms will be processed. if you want to command a certain prefix please fill AFI for example (so that SMS will be processed with the AFI berawalan only)
4. contents Receive Phone Number (s) as you fill in the SMSC connection earlier. (IM3 number in the GSM Modem / K750i)
5. Execute the command with the contents: http://localhost/nowsms/index.php?isi = @ @ @ @ FULLSMS
6. click ADD
7. Click Apply