SMS_Site_rbkuk - $msg = urlencode($this->get_message());...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
<?php /** * RBK UK - http://uk.rbk.com * * This site only sends to UK and Ireland mobiles only. * * @author Keyvan Minoukadeh <[email protected]> * @version 1.0 */ class SMS_Site_rbkuk extends SMS_Site { /** * Constructor */ function SMS_Site_rbkuk() { // call parent constructor method parent::SMS_Site(); // set up anything specific to this site // any country codes the site supports should be set here. $this->set_country_codes(array('44')); } function send() { // create reference to our HTTP client $ua =& $this->get_http_client(); // create a simple POST request Command=Send'); // add our referer field to our POST request $req->referer('http://uk.rbk.com/global/sms.asp'); // grab message number and message body $number = $this->get_number(); // must urlencode message body for this
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: $msg = urlencode($this->get_message()); // Set the body of our POST request $req->set_body('Country=44&Number='.$number.'&SenderNumber=&Message='. $msg.'&submit1=+++Send+%3E%3E+++'); // send off request and create a reference to our HTTP_Response object // in $response var $response =& $ua->request($req); // check if request was successful if ($response->is_success()) { // get our response body string $body =& $response->get_body(); // check if message was sent if ((strpos($body, 'Message+Sent') !== false) || (strpos($body, 'Message Sent') !== false)) { // messages was sent return true; } else { // send failed // set error message and number $this->set_error('Couldn\'t send', SWS_ERR_SEND); return false; } } $this->set_error('Unexpected HTTP response'); return false; } } ?>...
View Full Document

This note was uploaded on 01/31/2011 for the course CS 302 taught by Professor J.parker during the Spring '08 term at University of Texas at Austin.

Page1 / 2

SMS_Site_rbkuk - $msg = urlencode($this->get_message());...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online