- Products
- Ozeki 10
- SMS
- Ozeki 10 SMS gateway
- Ozeki NG SMS Gateway
- SMS protocol converters
- SMS router
- Message Server 6
- SMS Wall
- IP SMS Gateway
- Android SMS
- Excel SMS
- Bulk Messenger
- Cluster Software
- Developer tools
- Robots
- Hardware
- Technology
- Sales
PHP and MySQL make up what must be the best combination for data-driven
Web sites on the planet. If you are using PHP and MySQL on your website
and would like to integrate SMS messaging into your application, follow
the steps below. The following steps work on Linux, Soliaris,
MacOSX and Windows platforms. In this example we assume that you have an Apache
webserver with PHP support configured with a MySQL database
server on a Linux machine. You would like send SMS messages with the
Ozeki Sms Server, which is installed on another PC running Microsoft
Windows. On your UNIX (Linux) server:Step 1
Step 2 Create the database tables for sending and receiving SMS messages
After you have created the database table, don't forget to create a user with appropriate privileges. This user has to be able to log in to the database from the Windows PC and should have privileges for selecting and inserting records into the newly created tables. On your Windows PCStep 3 Configure your ODBC data source. Go to Control Panel and then click on Administrative Tools and then click on Data Source (ODBC) Click on User DSN Tab (by default it is on that) abd click Add as shown in the figure above. Scroll down and select the MySQL ODBC Driver. In the MySQL ODBC driver configuration enter the details as seen in the figure (in the database name enter your database name) and after you fill in all the proper fields click on the Test Data Source to check if you have properly configured your Database settings. Step 6 Install the OZEKI SMS Server. You can read the installation instructions at the installation manual. Step 7 After the installation activate the Database plugin: Select Install plugins from the menu Select Database from the drop down and hit the Install button. After the plugin is activated you can configure it. Step 7 Configure the database connection in Ozeki SMS You can do this by clicking on the configure button at the plugin activation form. On the Database Settings form, clik on the Build database connection button. This will bring up the connection selection dialog. On the connection tab, you can specify the ODBC datasource: mybuddy, and you can supply the login name and the password: After this is done, make sure you test the connection by clicking on the Test Connection button located in the lower right hand corner of the form. Press OK to finalize your settings.
|
SENDING SMS MESSAGES <? # Connect to the database mysql_connect('localhost','john','pass'); Function send_sms($phone,$message) { $sql = "insert into ozekismsout (receiver,msg,status) values ('$phone','$msg','send')"; mysql('dbname',$sql); }; send_sms("+362012234567","Hello World!"); ?> |
RECEIVING SMS
MESSAGES <? # Connect to the database mysql_connect('localhost','john','pass'); $sql = "select sender,msg from ozekismsin"; $res = mysql('dbname',$sql); $count = mysql_num_rows($res); for ($x=0;$x<$count;$x++) { list ($num,$message) =mysql_fetch_row($res); echo "$num - $message <br>"; } ?> |
When the appropriate scripts are created you are ready to send and receive sms messages from your webpages.
The great thing about this approach is that it is very convenient to use and it can survive network errors. If, for example, the network connection between the database server and the SMS server failes for a period of time, all the incoming and ougoing messages are saved. When the connection resumes they are sent or inserted to the database. You can monitor ODBC events with the help of the event monitor window of the Ozeki Sms Server.