|
PHP SMS API for PHP Developers
On this page I give you some information
on how you can use PHP to send and receive SMS messages.
This guide is an overview. It was designed to help you pick the
most appropriate method for your solution.
Send / receive SMS from PHP using a database
Most PHP enabled websites use a database server (MySQL or PostgreSQL) for
data storage. These database solutions integrate well with the needs
of PHP developers. If you use a database server for your website, you
should consider to setup an SQL SMS Gateway configuration for your system (Figure 1). The
SQL SMS Gateway configuration of Ozeki NG will work the following way:
You have to create two database tables. One will be used for receiving SMS messages
(ozekimessagein) and another will be used to send SMS messages (ozekimessageout).
If an SMS message is received by the system Ozeki NG will insert a record into
ozekimessagein. Your PHP application can read the ozekimessagein database table
and check for incoming messages.
Figure 1 - PHP SMS from SQL
If you want to send a message, you can use the ozekimessageout table. You
can insert a record into ozekimessageout. Ozeki NG SMS Gateway will periodically
check your outgoing database table using an SQL SELECT and if it finds a
message to be sent it will send it.
This PHP - database - SMS solution is described in more detail on the following
pages:
SQL SMS Gateway configuration
How to add SMS functionality to your w ebsite with PHP and MySQL
MySQL information for SMS sending
Send / receive SMS from PHP using HTTP
If you don't have a database server attached to your website or you
do not want to use it, you can use HTTP requests and communicate directly
with the SMS Gateway (Figure 2).

Figure 2 - PHP SMS using HTTP
The advantage to this solution is that it is faster
in terms of reaction times. If you are receiving an SMS message using
an HTTP SMS Gateway configuration, you can react immediately with a
response SMS. The following pages discuss in great detail how you can
receive SMS messages or send SMS messages from your PHP enabled website
using HTTP.
Receive SMS on a website using PHP
Send SMS from a website using PHP
|