Hardware Reference
In-Depth Information
$data = "uname=".$uname."&pword=".$pword."&message=".$message."&from=".
$fromAddr."&selectednums=".$toAddr."&info=1&test=0";
$ch = curl_init(' http://www.txtlocal.com/sendsmspost.php ');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
?>
The prologue to each piece of code is intentionally identical. This allows you to use either service interchangeably,
maybe on a round-robin basis, according to whether you have credit or are sending a high- or low-priority message.
By writing two differently named scripts, you can then either switch between them manually by issuing the following or
have a separate script called mxsms that determines which transport to use:
ln -s mxsms-intelli mxsms
I have passed a $type parameter into this code so that SMS, for example, can become sms-high , as mentioned
earlier. This can also be used to change the $fromAddr , which appears on your phone when you receive the message.
It is limited to 11 characters, but since it is customizable, it could become part of your message, maybe to indicate the
following:
u
The priority of the message
u
The service provider used
u
The number of credits left
u
The first 11 letters of the message
Each provider has a slightly different API, with different functionality, but as far as the end result is concerned,
they can all be used the same way.
Some of the applications of SMS include sending daily weather reports, news feeds, or lottery results to your
phone—or reporting when other house dwellers have arrived or left for work (so you can phone and encourage
them otherwise).
N The SMS protocol, as available to consumers, does not guarantee that the message will arrive or that it will
arrive promptly. Most do, but it is possible (as most of us have experienced firsthand) for them to be delayed by hours,
or even days, and sometimes they never appear at all. You should therefore have nothing critical—such as life-support
machines—reliant on these messages.
Note
There are two other types of message you may want to send, WAP and binary. A WAP message is a single-credit
SMS message that includes a piece of text and a URL, which can be opened using the phone itself (which may incur a
cost on that device). This can be used for more complex statistical information, where the executive summary is in the
text, with the URL linking to a prebuilt graph that is uploaded to your WAP server at the same time.
The binary message is 140 octets of geeky goodness but because of its size is limited to sending small logos
(which can also represent server performance graphs!) or ringtones.
 
Search WWH ::




Custom Search