OZEKI
Message Server 6
"The world's favourite SMS server"
info@ozeki.hu
Tel.: 00 36 52 532 731

SMS Server 6
On-line manual
Introduction
SMS technology
MMS technology
About
Product features
Installation guide
User guide
Developers guide
General information
Languages
C++ SMS
SQL SMS
HTTP SMS
Files SMS
Java SMS
PHP SMS
Quiz game
ASP SMS
Delphi SMS
C# SMS
Access SMS
SMS FAQ
Case studies
Appendix
Search
Download
Home
Support
How to buy
Resellers
SMS Wall
IP SMS Gateway
Excel SMS
Company


On-line manual:
  Explore all the features in this on-line HTML documentation.
Product guide:
  This downloadable pdf explains all the features of Message Server 6.


Newsletter:
  Sign up to get news about product updates!

E-mail:
  You can send tech. questions in e-mail to the following address: info @ ozeki.hu


Did you know?
Ozeki offers a very high performance SMS Gateway system as well called Ozeki NG SMS Gateway. It can send and receive up to 500 SMS messages per second.

Ozeki Phone System XE VoIP PBX software is an advanced PBX built for automated voice calls and 2 way SMS messaging. It has outstanding APIs for software developers.

Ozeki VoIP SIP SDK is a great tool for software developers who wish to get involved in voip phone client or voip phone service development.

OZEKI MESSAGE SERVER - Product Guide

Java SMS Contents | SearchQuiz game

Home > Developers guide > Languages > PHP SMS

SMS API for PHP developers

Ozeki Message Server can be used to send out SMS messages from any application. In order to send a message, the application must perform an HTTP request. The built in webserver of the Ozeki Message Server receives the request and adds the posted SMS message to the outgoing message queue. After some time the message will be sent. (The status of the outgoing message can be queried by subsequent HTTP requests)

To send an SMS message from PHP, you may use the following code. This example will send a text message containing the text Hello World to the telephone number +36205222245.

PHP EXAMPLE
http://localhost/smssend.php

<?php
  $gatewayURL  =   'http://localhost:9333/ozeki?';
  $request = 'login=admin';
  $request .= '&password=abc123';
  $request .= '&action=sendMessage';
  $request .= '&messageType=SMS:TEXT';
  $request .= '&recepient='.urlencode('+36205222245');
  $request .= '&messageData='.urlencode("Hello World");

  $url =  $gatewayURL . $request;  

  //Open the URL to send the message
   file($url);
?>

Binary message types such as WAP PUSH messages, Operator Logos and Ringtones can also be sent using this technique. All you have to do is change the messageType field and the message content. A list of supported message types can be found on the following URL: http://www.ozeki.hu/index.php?owpn=488.

PHP EXAMPLE 2
http://localhost/index.php

The code below will display an HTML form including fields for the sender, the recepient, the message, as well as a Send button. It contains a PHP code which will process the contents of the form and send an SMS mesage to the Ozeki Message Server if you click on the Send button. During the processing, make sure you use urlencoding, otherwise the PHP will send incorrect data to the Message Server.

<?php
if ($submit=="Send")
{
$url='http://localhost:9333/ozeki?';
$url.="action=sendMessage";
$url.="&login=admin";
$url.="&password=abc123";
$url.="&recepient=".urlencode($recepient);
$url.="&messageData=".urlencode($message);
$url.="&sender=".urlencode($sender);
file($url);
}
?>
<html>
<form method=post action='index.php'>
<table border=0>
<tr>
<td>Sender</td><td><input type='text' name='sender'></td>
</tr>
<tr>
<td>Recepient</td><td><input type='text' name='recepient'></td>
</tr>
<tr>
<td>Message</td><td><input type='text' name='message'</td>
</tr>
<tr>
<td colspan=2><input type=submit name=submit value=Send>
</form>
</tr>
</table>
</form>
</html>



Questions: How do I tell a PHP application to use an specific smpp connection.

Answer: You should specify the "Operator name" on the SMPP configuration form. Then you can use this operator name in the PHP application. E.g. if you put "Vodafone1" as operator name in the SMPP configuration form, in the PHP plugin you should write:

echo "{GSMSMS}{Vodafone1}{}{+36201234567}{Hello world}\n";






Next page: Quiz game