Home
Videos
Android GSM Modem
Send FREE SMS in PHP - Receive FREE SMS in PHP

Send FREE SMS in PHP - Receive FREE SMS in PHP

Description

Send FREE SMS in PHP - Receive FREE SMS in PHP using your android mobile device as GSM Modem device or SMS Gateway. You will find great guide and easy steps to learn; How to send or Receive FREE SMS in your PHP project.

In this video tutorial we will go step by step to write sample code for sending or receiving FREE SMS in your PHP project. Before getting started you must have installed GSM Modem android application in your device so that you could send or receive SMS from your mobile device.

Pre-Requisites

Before getting started you must have pre-requisites.

  • You must have an android device.
  • GSM Modem Application must be installed on your device.
  • In GSM Modem Application both Servers are started (first for sending sms, second for receiving sms).


Code for Sending SMS

Let's write code for sending SMS in PHP first. In following php code we have a form where you can add phone number and message only but the configuration for server, we have put it as static for now. If you want to put configuration in your project you may go through environment variables or any other approach.

Filename: sendSMS.php


Code for Receiving SMS

In receiving SMS code, we have used MySQL database so that when message will be received then save directly to the database, refresh the page you will have list of messages and  phone numbers on your page.

Filename: receiveSMS.php