PHP Classes
Icontem

File: test/simple_send.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Keyvan Minoukadeh  >  SMS Web Sender  >  test/simple_send.php  
File: test/simple_send.php
Role: Unit test script
Content type: text/plain
Description: simple send example
Class: SMS Web Sender
Free SMS sending through existing SMS sites
 

Contents

Class file image Download
<?php
/*
This file demonstrates a simple use of SMS Web Sender.

You will need to change the login and number details to your own.
*/

// COMMENT OUT THIS LINE TO ENABLE
die('DISABLED - remove line '.__LINE__.' in '.basename(__FILE__).' to enable');

// for debugging reasons we enable all error reporting
// and output the <pre> tag to preserve text formatting
error_reporting (E_ALL);
echo 
'<pre>';

// include required classes
// SMS Web Sender requires HTTP Navigator 2.2 or later, you must define
// HTTPNAV_ROOT as SMS_Web_Sender will use it to find the relevant classes
define('HTTPNAV_ROOT'realpath('../../http_navigator/classes/').'/');
require_once(
'../classes/SMS_Web_Sender.php');

// set debug level
// Debug::level(DEBUG_OUTPUT_FILENAME);
Debug::level(DEBUG_OUTPUT_FILENAME DEBUG_OUTPUT_LINE);

// create instance of SMS_Web_Sender
$sws =& new SMS_Web_Sender();

// add sites (uncomment lines and change 'user' 'pass' to your login
// details for that site)
//$sws->add_site('1rstwap', 'user', 'pass');
//$sws->add_site('rbkuk');
//$sws->add_site('boltblue', 'user', 'pass');
//$sws->add_site('sms_ac', 'user', 'pass');
//$sws->add_site('o2-genie', 'user', 'pass');
//$sws->add_site('fonetastic', 'phone', 'pass');

// attempt send (modify country code, number and message)
if ($sws->send('+44''07977777777''Hello, just testing')) {
    
// send() will return true on success...
    
echo 'Sent!';
} else {
    
// false on error
    
echo 'Send failed';
}

echo 
'</pre>';

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products