PHP MySQL SMS Application.pdf | Short Message Service | Php

July 5, 2017 | Author: Anonymous | Category: PHP, MySQL
Share Embed


Short Description

OZEKI NG SMS Gateway - Product Guide. Contents | Search. Home > Product Manual > Developers Guide > PHP SMS API...

Description

SMS Gateway - PHP SMS API, PHP5 and MySQL

Page 1 of 4 Website updated on: Wednesday, August 26, 2009 On-line manual:

Overview

Quick start

Download

Manual

How to buy

FAQ

Search

Contact Us

OZEKI NG SMS Gateway - Product Guide

Contents | Search

Home > Product Manual > Developers Guide > PHP SMS API > PHP5 and MySQL

SMS Gateway Home

PHP Developers! Start by checking out the possible solutions on how to add SMS functionality to your website. Read the quick overview: Beginners: How to send/receive SMS with PHP...

How to send SMS from a website using PHP and MySQL download full project (2.2 kB)

Introduction This article is about sending SMS using PHP through MySQL Server. It is intended for web developers with a basic knowledge of the PHP and SQL technologies. The page contains a downloadable source code (see above), a list of aims you can achieve using the code, a list of prerequisites, a description and depiction of the architecture and operation of the system, step-by-step instructions about how to use the code and a detailed interpretation. It also includes a brief summary, answers to frequently asked questions, as well as links to related information.

When to use this code Send SMS using HTTP: With PHP you can easily submit SMS messages using HTTP requests:

This code is particularly useful for those who wish to l l l

Send SMS (PHP + HTML form) Send SMS (URL examples)

The Ozeki NG SMS Gateway can send incoming messages to your PHP website through HTTP GET and POST requests: Receive SMS using PHP and HTTP

l

add SMS functionality to a website. add SMS functionality to a corporate Intranet. create automated SMS notifications. increase website security by adding SMS login.

Prerequisites The following table gives you a checklist on what you need to add SMS functionality to your MySQL enabled PHP website. PHP host:

Operating system: Linux or Windows Webserver (Apache, or IIS) PHP MySQL Server

SMS Gateway host: Operating system: Windows or Linux .NET framework (if you use Windows) or Mono (if you use Linux) Ozeki NG-SMS gateway Ozeki NG SMS Gateway can be obtained by

SMS from MySQL: If your website has a MySQL database, check out the following information: Send SMS from MySQL

opening the download page: Download Ozeki NG SMS Gateway!

How it works To send SMS messages from PHP applications, you need to install Ozeki NG SMS Gateway and Microsoft SQL Server on your computer. Ozeki NG - SMS Gateway will use a GSM phone/modem attached to your PC (with a phone-to-PC data cable) or an IP SMS connection to send messages. Your PHP application will insert a row into the database to send messages using the Ozeki NG program. For a better understanding of how it works, please look at the following diagram (Figure 1).

Figure 1 - Sending SMS from PHP through a MySQL database server In the diagram you can see an Internet user, a web server with the PHP application, an SQL Server, Ozeki NG - SMS Gateway, a mobile phone attached to ther server computer and a mobile user receiving the message. Wherever the Internet user is, if they know the IP address or URL of the computer running the PHP script, and if they are authorized to log in, they can compose and send messages to any recipients. After the Internet user's action, the PHP application inserts a row with the data of the SMS to be sent, which will be selected by Ozeki NG - SMS Gateway from the database. Ozeki NG will forward the message to the GSM network through a mobile phone attached to the PC with a data cable, and the mobile user will receive the SMS message.

Create a user and a database in MySQL To find out how, check out the MySQL create table script page.

Create a Database user in Ozeki NG - SMS Gateway Step 1: Open Ozeki NG's graphical user inerface (Start menu -> All Programs -> OzekiNG -> Manage OzekiNG). Picture help Step 2: Create the database user in Ozeki NG with the necessary data following the instructions.

Using the code To use the downloaded PHP code, follow these steps: Step 1: Unpack the downloaded zip file. Step 2: Copy the sqlsmshandling.php, sqlsmshandling_inoutmessages.php and sqlsmshandling_functions.php files into the main directory of the Web Server.

8/27/2009

SMS Gateway - PHP SMS API, PHP5 and MySQL

Page 2 of 4

Step 3: Set/Change the fixed data in the sqlsmshandling_functions.php file (e.g., server name, user name, password). Picture help Step 4: Start the Ozeki NG - SMS Gateway Server (if not running). Picture help Step 5: Start a web browser application (IE, Firefox, etc.) and enter this: http://127.0.0.1/sqlsmshandling.php (127.0.0.1 means that the copied example files reside on the same computer on which the browser has been opened). Picture help Step 6: Fill in the necessary fields, and then click the "Send" button. Picture help Step 7: Verify the message has been sent by Ozeki NG - SMS Gateway. Picture help

Understanding the code The downloadable sample script inserts the message to be sent into the ozekimessageout database table. Ozeki NG - SMS Gateway periodically checks the table, and if it finds a row where the status is send, then it will try to send it. Inside the script you have to set the server name to where the MySQL Server is running, the username (specifying who can log in to the MySQL Server) with the password and the type of the SMS message. The source code of the example application is structured in the following way: sqlsmshandling.php: This file contains page builder asp elements (text boxes, labels, etc.) and calls an insert function. sqlsmshandling_functions.php: connectToDatabase(): connects to the MySQL Server and opens the database. closeConnection (): closes the connection. insertMessage (...): inserts the message to the outgoing database table. showOutgoingMessagesInTable(): selects the messages from ozekimessageout database table and shows it. showIncomingMessagesInTable(): selects the messages from ozekimessagein database table and shows it. sqlsmshandling_inoutmessages.php: builds the page that shows the message tables. Description of the process depicted in Figure 1 above: Step 1: Create the HTML form In the sqlsmshandling.php file, you create the form that requests the sms data and shows a frame for tables incoming and outgoing messages. The Internet user fills in the necessaries. Label and textbox pairs will be displayed. Labels identify the requested data for the Internet user, and they will type it in textboxes. The user will be asked to fill in the Recipient and Message text fields. sqlsmshandling.php ... Compose message Recipient: ... Message text: ... ... ...

Inside the last table row () you perform the sending of the message, as well as the notification of the Internet user in case of an error. ...
View more...

Comments

Copyright © 2017 DATENPDF Inc.