Overview:

    * This Php sample code will allow a user to send an sms message from a cell phone to the iSMS device and the iSMS device will send it to the Apache Web Server via IP. The Apache Web Server will then call the Php script to write the incoming sms message to a text file on the local hard drive.

Prerequisite:

    * Download the Unzip Php Interpreter Windows Binaries - PHP 5.2.14 Zip Package onto your PC at http://php.net/downloads.php
    * Download and Install Apache Web Server httpd-2.2.15-win32-x86-no_ssl.msi at http://httpd.apache.org/download.cgi
    * Download the Php sample source code iSMSSendAndReceive-Php.zip here

Modify the httpd.conf:

1. Put these lines at the bottom of the httpd.conf file and change the path so that it points to your PHP directory:

# Begin enable php5
LoadModule php5_module "C:/Program Files (x86)/PHP5/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/Program Files (x86)/PHP5"
# End enable php5

2. Save it and restart the Web Server.

iSMS device setup:

    * Go to your SMS finder -> SMS Service -> SMS API:
    * HTTP API status: Checked.
    * HTTP port: 81.
    * Click on Save Button.
    * None polling Receive API status: Checked.
    * Protocol: HTTP.
    * Click on Save Button.
    * Server: xxx.xxx.xxx.xxx (Enter your Web server IP address here)
    * Port: 80.
    * Click on Save Button.
    * Server Default Page: ismsResponse.php.
    * Click on Save Button.

3. Put the ismsResponse.php, ismsSend.php and ismsSend.html under the Apache /htdocs folder.

Notes:

    * If you send an sms message from your cell phone to the iSMS device, the iSMS device will send that sms message to the Web Server and Web Server will call the ismsResponse.php to write the message to a text file named – receive.txt.
    * ismsSend.html is an html form that allows you to send the sms message from your web browser.
    * You must also modify the ismsSend.php to point to your iSMS device before you can send the sms message to iSMS device via Web browser.

Modify the ismsSend.php:

Find these lines below and modify so that it points to your iSMS device, and also change the user name and password to match yours.

$fp = fsockopen("216.133.69.246",81, $errno, $errstr, 30);
$out = "GET /sendmsg?user=admin&passwd=admin&cat=1&"."to=".$phonenum."&text=".$message." HTTP/1.1\r\n";

Save it.

Now, you should be able to send a SMS message to your iSMS device through the Web browser. Bring up your web browser (IE or FireFox) and go to http://localhost/ismsSend.html. You will get a Send Message Form.