Send SMS messages from PHP

How to send messages from a web page

The Ozeki SMS Server enables you to send SMS messages from PHP scripts. The SMS Server and the PHP script can be located on two different computers. This means that more than one script can send messages at the same time with only one SMS Server (figure 1.).

how to send sms from php
Figure 1 - How to send messages from a PHP web page

To send messages from PHP you need to use the file sendsms.php.

This file is included in the SMS Server software package. It provides functions to place the messages onto the SMS Servers queue for sending. Look at the following example:

     
<?php
include("sendsms.php");
$credits = sms_connect('192.168.0.1','9010','myAccount');

if($credits>0) { 
   sms_send('+36201234567','Hello World!');
}

sms_disconnect();
?>

Figure 2 - Example of sending SMS messages from PHP

More information